Skip to content

Commit

Permalink
fix warning message on initial render, add-tag test, and remove solid…
Browse files Browse the repository at this point in the history
… js references
  • Loading branch information
ameer2468 committed May 25, 2024
1 parent 4b2c951 commit 0ca241b
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 42 deletions.
3 changes: 1 addition & 2 deletions apps/mobile/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ module.exports = function (api) {
}
}
]
],
overrides: [{ test: /\.solid.tsx$/, presets: ['solid'] }]
]
};
};
1 change: 0 additions & 1 deletion apps/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"react-native-toast-message": "^2.2.0",
"react-native-wheel-color-picker": "^1.2.0",
"rive-react-native": "^6.2.3",
"solid-js": "^1.8.8",
"twrnc": "^4.1.0",
"use-count-up": "^3.0.1",
"use-debounce": "^9.0.4",
Expand Down
42 changes: 24 additions & 18 deletions apps/mobile/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ import {
NavigationContainer,
useNavigationContainerRef
} from '@react-navigation/native';
import {
ClientContextProvider,
LibraryContextProvider,
P2PContextProvider,
RspcProvider,
initPlausible,
useBridgeQuery,
useClientContext,
useInvalidateQuery,
usePlausibleEvent,
usePlausiblePageViewMonitor,
usePlausiblePingMonitor
} from '@sd/client';
import { QueryClient } from '@tanstack/react-query';
import dayjs from 'dayjs';
import advancedFormat from 'dayjs/plugin/advancedFormat';
Expand All @@ -17,19 +30,6 @@ import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { MenuProvider } from 'react-native-popup-menu';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { useSnapshot } from 'valtio';
import {
ClientContextProvider,
initPlausible,
LibraryContextProvider,
P2PContextProvider,
RspcProvider,
useBridgeQuery,
useClientContext,
useInvalidateQuery,
usePlausibleEvent,
usePlausiblePageViewMonitor,
usePlausiblePingMonitor
} from '@sd/client';

import { GlobalModals } from './components/modal/GlobalModals';
import { Toast, toastConfig } from './components/primitive/Toast';
Expand All @@ -55,13 +55,17 @@ function AppNavigation() {
const plausibleEvent = usePlausibleEvent();
const buildInfo = useBridgeQuery(['buildInfo']);

initPlausible({ platformType: 'mobile', buildInfo: buildInfo?.data });

const navRef = useNavigationContainerRef();
const routeNameRef = useRef<string>();

const [currentPath, setCurrentPath] = useState<string>('/');

useEffect(() => {
if (buildInfo?.data) {
initPlausible({ platformType: 'mobile', buildInfo: buildInfo.data });
}
}, [buildInfo]);

usePlausiblePageViewMonitor({ currentPath });
usePlausiblePingMonitor({ currentPath });

Expand All @@ -73,9 +77,11 @@ function AppNavigation() {
return () => clearInterval(interval);
}, [plausibleEvent]);

if (library === null && libraries.data) {
currentLibraryStore.id = libraries.data[0]?.uuid ?? null;
}
useEffect(() => {
if (library === null && libraries.data) {
currentLibraryStore.id = libraries.data[0]?.uuid ?? null;
}
}, [library, libraries]);

return (
<NavigationContainer
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/components/browse/BrowseTags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const BrowseTags = () => {
<Text style={tw`text-lg font-bold text-white`}>Tags</Text>
<View style={tw`flex-row gap-3`}>
<Button
testID='show-all-tags-button'
style={twStyle(`rounded-full`, {
borderColor: showAll ? tw.color('accent') : tw.color('border-app-lightborder')
})}
Expand Down
2 changes: 2 additions & 0 deletions apps/mobile/tests/add-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ appId: com.spacedrive.app
- inputText: 'MyTag'
- tapOn:
text: 'Create'
- tapOn:
id: 'show-all-tags-button'
- assertVisible: 'MyTag'
47 changes: 26 additions & 21 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0ca241b

Please sign in to comment.