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

Changed some messages and buttons to make it easier to open bookmarks editor

This commit is contained in:
Paweł Malak 2021-12-02 14:12:23 +01:00
parent 2ca90a18e1
commit 068c8ab2e7
10 changed files with 76 additions and 82 deletions

View file

@ -14,7 +14,14 @@ import { Category, Bookmark } from '../../interfaces';
import classes from './Bookmarks.module.css';
// UI
import { Container, Headline, ActionButton, Spinner, Modal } from '../UI';
import {
Container,
Headline,
ActionButton,
Spinner,
Modal,
Message,
} from '../UI';
// Components
import { BookmarkGrid } from './BookmarkGrid/BookmarkGrid';
@ -121,6 +128,11 @@ export const Bookmarks = (props: Props): JSX.Element => {
}
};
const finishEditing = () => {
setShowTable(false);
setEditCategory(null);
};
return (
<Container>
<Modal isOpen={modalIsOpen} setIsOpen={toggleModal}>
@ -150,14 +162,24 @@ export const Bookmarks = (props: Props): JSX.Element => {
icon="mdiPencil"
handler={() => showTableForEditing(ContentType.category)}
/>
<ActionButton
name="Edit Bookmarks"
icon="mdiPencil"
handler={() => showTableForEditing(ContentType.bookmark)}
/>
{showTable && tableContentType === ContentType.bookmark && (
<ActionButton
name="Finish Editing"
icon="mdiPencil"
handler={finishEditing}
/>
)}
</div>
)}
{categories.length && isAuthenticated && !showTable ? (
<Message isPrimary={false}>
Click on category name to edit its bookmarks
</Message>
) : (
<></>
)}
{loading ? (
<Spinner />
) : !showTable ? (