diff --git a/apps/mobile/src/views/Folders/index.js b/apps/mobile/src/views/Folders/index.js index b2bcf9cb0..3984343b4 100644 --- a/apps/mobile/src/views/Folders/index.js +++ b/apps/mobile/src/views/Folders/index.js @@ -31,7 +31,7 @@ export const Folders = ({navigation}) => { const [buttonHide, setButtonHide] = useState(false); const [margin, setMargin] = useState(180); const [numColumns, setNumColumns] = useState(1); - + const [pinned, setPinned] = useState([]); const isFocused = useIsFocused(); const params = navigation.state.params; @@ -44,7 +44,11 @@ export const Folders = ({navigation}) => { useEffect(() => { if (isFocused) { - setNotebooks(db.getNotebooks()); + setNotebooks([...db.getNotebooks()]); + + let pinItems = db.getPinned(); + + setPinned([...pinItems]); } }, [isFocused]); @@ -139,41 +143,71 @@ export const Folders = ({navigation}) => { : notebooks[0] ? 155 : 155 - 60, - }} - /> + }}> + {pinned && pinned.length > 0 ? ( + <> + item.dateCreated.toString()} + renderItem={({item, index}) => + item.type === 'notebook' ? ( + refresh()} + item={item} + numColumns={1} + index={index} + /> + ) : null + } + /> + + ) : null} + } ListEmptyComponent={ - - - - + pinned && pinned.length > 0 ? null : ( + + + + - - Notebooks you add will appear here - - - No Notebooks found - - + + Notebooks you add will appear here + + + No Notebooks found + + + ) } contentContainerStyle={{ width: '100%',