Files
spacedrive/apps/mobile/src/components/explorer/sections/Note.tsx
Brendan Allan 99a31de824 [ENG-380] Interface code structure improvement (#581)
* beginnings of app directory

* settings mostly good

* colocate way more components

* flatten components folder

* reexport QueryClientProvider from client

* move CodeBlock back to interface

* colocate Explorer, KeyManager + more

* goddamn captialisation

* get toasts out of components

* please eslint

* no more src directory

* $ instead of :

* added back RowHeader component

* fix settings modal padding

* more spacing, less margin

* fix sidebar locations button

* fix tags sidebar link

* clean up back button

* added margin to explorer context menu to prevent contact with edge of viewport

* don't export QueryClientProvider from @sd/client

* basic guidelines

* import interface correctly

* remove old demo data

* fix onboarding layout

* fix onboarding navigation

* fix key manager settings button

---------

Co-authored-by: Jamie Pine <ijamespine@me.com>
2023-02-27 21:29:48 -08:00

35 lines
731 B
TypeScript

import { useCallback, useState } from 'react';
import { Text, View } from 'react-native';
import { useDebouncedCallback } from 'use-debounce';
import { useLibraryMutation } from '@sd/client';
import { Object as SDObject } from '@sd/client';
type Props = {
data: SDObject;
};
const Note = (props: Props) => {
const [note, setNote] = useState(props.data.note || '');
const { mutate: fileSetNote } = useLibraryMutation('files.setNote');
const debounce = useDebouncedCallback(
(note: string) =>
fileSetNote({
id: props.data.id,
note
}),
2000
);
const debouncedNote = useCallback((note: string) => debounce(note), [debounce]);
return (
<View>
<Text>Note</Text>
</View>
);
};
export default Note;