1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-25 22:09:36 +02:00

Moved entityInUpdate to app state. It applies for apps, categories and bookmarks

This commit is contained in:
Paweł Malak 2021-11-22 14:36:00 +01:00
parent d110d9b732
commit dfdd49cf4a
15 changed files with 197 additions and 81 deletions

View file

@ -4,7 +4,7 @@ import classes from './TableActions.module.css';
interface Entity {
id: number;
name: string;
isPinned: boolean;
isPinned?: boolean;
isPublic: boolean;
}
@ -12,7 +12,7 @@ interface Props {
entity: Entity;
deleteHandler: (id: number, name: string) => void;
updateHandler: (id: number) => void;
pinHanlder: (id: number) => void;
pinHanlder?: (id: number) => void;
changeVisibilty: (id: number) => void;
showPin?: boolean;
}
@ -27,6 +27,8 @@ export const TableActions = (props: Props): JSX.Element => {
showPin = true,
} = props;
const _pinHandler = pinHanlder || function () {};
return (
<td className={classes.TableActions}>
{/* DELETE */}
@ -51,7 +53,7 @@ export const TableActions = (props: Props): JSX.Element => {
{showPin && (
<div
className={classes.TableAction}
onClick={() => pinHanlder(entity.id)}
onClick={() => _pinHandler(entity.id)}
tabIndex={0}
>
{entity.isPinned ? (