1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-24 21:39:36 +02:00

Added option to reorder bookmarks

This commit is contained in:
Paweł Malak 2021-11-25 16:54:27 +01:00
parent a02814aa02
commit ec5f50aba4
5 changed files with 35 additions and 10 deletions

View file

@ -69,12 +69,17 @@ export const Bookmarks = (props: Props): JSX.Element => {
}, [isAuthenticated]);
useEffect(() => {
if (categoryInEdit && !showTable) {
if (categoryInEdit) {
setTableContentType(ContentType.bookmark);
setShowTable(true);
}
}, [categoryInEdit]);
useEffect(() => {
setShowTable(false);
setEditCategory(null);
}, []);
// Form actions
const toggleModal = (): void => {
setModalIsOpen(!modalIsOpen);
@ -108,6 +113,7 @@ export const Bookmarks = (props: Props): JSX.Element => {
const showTableForEditing = (contentType: ContentType) => {
// We're in the edit mode and the same button was clicked - go back to list
if (showTable && contentType === tableContentType) {
setEditCategory(null);
setShowTable(false);
} else {
setShowTable(true);