diff --git a/apps/mobile/src/App.tsx b/apps/mobile/src/App.tsx index aa5faa512..2b1e45276 100644 --- a/apps/mobile/src/App.tsx +++ b/apps/mobile/src/App.tsx @@ -44,7 +44,7 @@ function AppContainer() { const { showOnboarding } = useSnapshot(onboardingStore); - const { data: libraries } = useBridgeQuery(['library.get'], { + const { data: libraries } = useBridgeQuery(['library.list'], { onError(err) { console.error(err); } diff --git a/apps/mobile/src/components/device/Device.tsx b/apps/mobile/src/components/device/Device.tsx index 0d2ea27b2..bcf1e246b 100644 --- a/apps/mobile/src/components/device/Device.tsx +++ b/apps/mobile/src/components/device/Device.tsx @@ -16,48 +16,11 @@ const placeholderFileItems: FilePath[] = [ extension: '', file_id: 1, id: 1, - key: null, location_id: 1, materialized_path: '', name: 'Minecraft', parent_id: 0, - key_id: null, - location: null, - file: { - id: 1, - key_id: 1, - albums: [], - comments: [], - key: { - algorithm: null, - checksum: '', - date_created: null, - file_paths: [], - files: [], - id: 1, - name: 'Hello world' - }, - labels: [], - media_data: null, - spaces: [], - tags: [], - cas_id: '', - ipfs_id: '', - has_thumbnail: false, - favorite: false, - has_thumbstrip: false, - has_video_preview: false, - hidden: false, - important: false, - integrity_checksum: '', - kind: 1, - note: '', - paths: [], - size_in_bytes: '555', - date_created: '', - date_indexed: '', - date_modified: '' - } + key_id: null }, { is_dir: true, @@ -67,48 +30,11 @@ const placeholderFileItems: FilePath[] = [ extension: '', file_id: 2, id: 2, - key: null, location_id: 2, materialized_path: '', name: 'Documents', parent_id: 0, - key_id: null, - location: null, - file: { - id: 2, - key_id: 2, - albums: [], - comments: [], - key: { - algorithm: null, - checksum: '', - date_created: null, - file_paths: [], - files: [], - id: 1, - name: 'Hello world' - }, - labels: [], - media_data: null, - spaces: [], - tags: [], - cas_id: '', - ipfs_id: '', - has_thumbnail: false, - favorite: false, - has_thumbstrip: false, - has_video_preview: false, - hidden: false, - important: false, - integrity_checksum: '', - kind: 1, - note: '', - paths: [], - size_in_bytes: '555', - date_created: '', - date_indexed: '', - date_modified: '' - } + key_id: null }, { is_dir: false, @@ -118,48 +44,11 @@ const placeholderFileItems: FilePath[] = [ extension: 'tsx', file_id: 3, id: 3, - key: null, location_id: 3, materialized_path: '', name: 'App.tsx', parent_id: 0, - key_id: null, - location: null, - file: { - id: 3, - key_id: 3, - albums: [], - comments: [], - key: { - algorithm: null, - checksum: '', - date_created: null, - file_paths: [], - files: [], - id: 1, - name: 'Hello world' - }, - labels: [], - media_data: null, - spaces: [], - tags: [], - cas_id: '', - ipfs_id: '', - has_thumbnail: false, - favorite: false, - has_thumbstrip: false, - has_video_preview: false, - hidden: false, - important: false, - integrity_checksum: '', - kind: 1, - note: '', - paths: [], - size_in_bytes: '555', - date_created: '', - date_indexed: '', - date_modified: '' - } + key_id: null }, { is_dir: false, @@ -169,48 +58,11 @@ const placeholderFileItems: FilePath[] = [ extension: 'vite', file_id: 4, id: 4, - key: null, location_id: 4, materialized_path: '', name: 'vite.config.js', parent_id: 0, - key_id: null, - location: null, - file: { - id: 4, - key_id: 4, - albums: [], - comments: [], - key: { - algorithm: null, - checksum: '', - date_created: null, - file_paths: [], - files: [], - id: 1, - name: 'Hello world' - }, - labels: [], - media_data: null, - spaces: [], - tags: [], - cas_id: '', - ipfs_id: '', - has_thumbnail: false, - favorite: false, - has_thumbstrip: false, - has_video_preview: false, - hidden: false, - important: false, - integrity_checksum: '', - kind: 1, - note: '', - paths: [], - size_in_bytes: '555', - date_created: '', - date_indexed: '', - date_modified: '' - } + key_id: null }, { is_dir: false, @@ -220,48 +72,11 @@ const placeholderFileItems: FilePath[] = [ extension: 'docker', file_id: 5, id: 5, - key: null, location_id: 5, materialized_path: '', name: 'Dockerfile', parent_id: 0, - key_id: null, - location: null, - file: { - id: 5, - key_id: 5, - albums: [], - comments: [], - key: { - algorithm: null, - checksum: '', - date_created: null, - file_paths: [], - files: [], - id: 1, - name: 'Hello world' - }, - labels: [], - media_data: null, - spaces: [], - tags: [], - cas_id: '', - ipfs_id: '', - has_thumbnail: false, - favorite: false, - has_thumbstrip: false, - has_video_preview: false, - hidden: false, - important: false, - integrity_checksum: '', - kind: 1, - note: '', - paths: [], - size_in_bytes: '555', - date_created: '', - date_indexed: '', - date_modified: '' - } + key_id: null } ]; diff --git a/apps/mobile/src/components/file/FileIcon.tsx b/apps/mobile/src/components/file/FileIcon.tsx index 101f78dc9..db646bebe 100644 --- a/apps/mobile/src/components/file/FileIcon.tsx +++ b/apps/mobile/src/components/file/FileIcon.tsx @@ -17,13 +17,16 @@ type FileIconProps = { }; const FileIcon = ({ file, size = 1 }: FileIconProps) => { + // Temp + const has_thumbnail = false; + return ( {file?.is_dir ? ( - ) : file?.file?.has_thumbnail ? ( + ) : has_thumbnail ? ( <>{/* TODO */} ) : ( diff --git a/apps/mobile/src/components/modals/FileModal.tsx b/apps/mobile/src/components/modals/FileModal.tsx index d34ae6aa3..f46017c73 100644 --- a/apps/mobile/src/components/modals/FileModal.tsx +++ b/apps/mobile/src/components/modals/FileModal.tsx @@ -92,9 +92,8 @@ export const FileModal = () => { {/* Details */} <> - {data?.file?.cas_id && ( - - )} + {/* Temp, we need cas id */} + {data?.id && } { const store = useSnapshot(libraryStore); - const { data: libraries } = useBridgeQuery(['library.get']); + const { data: libraries } = useBridgeQuery(['library.list']); // memorize library to avoid re-running find function const currentLibrary = useMemo(() => { diff --git a/apps/mobile/src/types/declarations.d.ts b/apps/mobile/src/types/declarations.d.ts index 9452b908f..1eae33fe9 100644 --- a/apps/mobile/src/types/declarations.d.ts +++ b/apps/mobile/src/types/declarations.d.ts @@ -1,13 +1,6 @@ -import 'valtio'; - declare module '*.svg' { import React from 'react'; import { SvgProps } from 'react-native-svg'; const content: React.FC; export default content; } - -// Loosen the type definition of the `useSnapshot` hook -declare module 'valtio' { - function useSnapshot(p: T): T; -} diff --git a/apps/mobile/src/types/valtio.d.ts b/apps/mobile/src/types/valtio.d.ts new file mode 100644 index 000000000..49886ecfd --- /dev/null +++ b/apps/mobile/src/types/valtio.d.ts @@ -0,0 +1,6 @@ +// Loosen the type definition of the `useSnapshot` hook +import 'valtio'; + +declare module 'valtio' { + function useSnapshot(p: T): T; +}