mirror of
https://github.com/pawelmalak/flame.git
synced 2026-03-10 14:33:11 +08:00
Moved entityInUpdate to app state. It applies for apps, categories and bookmarks
This commit is contained in:
@@ -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 ? (
|
||||
|
||||
Reference in New Issue
Block a user