diff --git a/web/src/components/ShortcutView.tsx b/web/src/components/ShortcutView.tsx index 0e0168d..1caa9c8 100644 --- a/web/src/components/ShortcutView.tsx +++ b/web/src/components/ShortcutView.tsx @@ -17,10 +17,7 @@ interface Props { const ShortcutView = (props: Props) => { const { shortcut, handleEdit } = props; const user = useAppSelector((state) => state.user.user as User); - - const havePermission = (shortcut: Shortcut) => { - return user.role === "ADMIN" || shortcut.creatorId === user.id; - }; + const havePermission = user.role === "ADMIN" || shortcut.creatorId === user.id; const handleCopyButtonClick = (shortcut: Shortcut) => { copy(absolutifyLink(`/s/${shortcut.name}`)); @@ -58,29 +55,29 @@ const ShortcutView = (props: Props) => { - - - - - } - > + {havePermission && ( + + + + + } + > + )} {shortcut.description &&

{shortcut.description}

}