Fix everything after rspc update

This commit is contained in:
Utku Bakir
2022-09-07 10:49:27 +03:00
parent 8290318500
commit 84e2b1fa4a
7 changed files with 19 additions and 203 deletions

View File

@@ -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);
}

View File

@@ -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
}
];

View File

@@ -17,13 +17,16 @@ type FileIconProps = {
};
const FileIcon = ({ file, size = 1 }: FileIconProps) => {
// Temp
const has_thumbnail = false;
return (
<View style={[tw`justify-center`, { width: 60 * size, height: 60 * size }]}>
{file?.is_dir ? (
<View style={tw`items-center`}>
<FolderIcon size={50 * size} />
</View>
) : file?.file?.has_thumbnail ? (
) : has_thumbnail ? (
<>{/* TODO */}</>
) : (
<View style={[tw`m-auto relative`, { width: 45 * size, height: 60 * size }]}>

View File

@@ -92,9 +92,8 @@ export const FileModal = () => {
{/* Details */}
<Divider style={tw`mt-6 mb-4`} />
<>
{data?.file?.cas_id && (
<MetaItem title="Unique Content ID" value={data.file.cas_id as string} />
)}
{/* Temp, we need cas id */}
{data?.id && <MetaItem title="Unique Content ID" value={'555555555'} />}
<MetaItem title="URI" value={`/Users/utku/Somewhere/vite.config.js`} />
<Divider style={tw`my-4`} />
<MetaItem

View File

@@ -31,7 +31,7 @@ export const libraryStore = proxyWithPersist({
// is memorized and can be used safely in any component
export const useCurrentLibrary = () => {
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(() => {

View File

@@ -1,13 +1,6 @@
import 'valtio';
declare module '*.svg' {
import React from 'react';
import { SvgProps } from 'react-native-svg';
const content: React.FC<SvgProps>;
export default content;
}
// Loosen the type definition of the `useSnapshot` hook
declare module 'valtio' {
function useSnapshot<T extends object>(p: T): T;
}

6
apps/mobile/src/types/valtio.d.ts vendored Normal file
View File

@@ -0,0 +1,6 @@
// Loosen the type definition of the `useSnapshot` hook
import 'valtio';
declare module 'valtio' {
function useSnapshot<T extends object>(p: T): T;
}