chore: add shortcut creator field

This commit is contained in:
Steven
2022-09-17 11:35:44 +08:00
parent de83467c45
commit 273bfb1d13
6 changed files with 46 additions and 11 deletions

View File

@ -33,14 +33,15 @@ const ShortcutListView: React.FC<Props> = (props: Props) => {
<span className="text-gray-400 text-sm ml-2">({shortcut.description})</span>
</div>
<div className="flex flex-row justify-end items-center">
<span
<span className=" w-12 mr-2 text-gray-600">{shortcut.creator.name}</span>
<button
className="cursor-pointer mr-4 hover:opacity-80"
onClick={() => {
handleCopyButtonClick(shortcut);
}}
>
<Icon.Copy className="w-5 h-auto" />
</span>
</button>
<a className="cursor-pointer mr-4 hover:opacity-80" target="blank" href={shortcut.link}>
<Icon.ExternalLink className="w-5 h-auto" />
</a>
@ -49,14 +50,14 @@ const ShortcutListView: React.FC<Props> = (props: Props) => {
<>
<button
disabled={shortcut.creatorId !== user?.id}
className="w-full px-2 text-left leading-8 cursor-pointer rounded hover:bg-gray-100 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:opacity-60"
className="w-full px-3 text-left leading-10 cursor-pointer rounded hover:bg-gray-100 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:opacity-60"
onClick={() => showCreateShortcutDialog(workspaceId, shortcut.id)}
>
Edit
</button>
<button
disabled={shortcut.creatorId !== user?.id}
className="w-full px-2 text-left leading-8 cursor-pointer rounded text-red-600 hover:bg-gray-100 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:opacity-60"
className="w-full px-3 text-left leading-10 cursor-pointer rounded text-red-600 hover:bg-gray-100 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:opacity-60"
onClick={() => {
handleDeleteShortcutButtonClick(shortcut);
}}

View File

@ -20,7 +20,7 @@ const WorkspaceListView: React.FC<Props> = (props: Props) => {
return (
<div key={workspace.id} className="w-full flex flex-row justify-between items-start border px-6 py-4 mb-3 rounded-lg">
<div className="flex flex-col justify-start items-start">
<Link to={`/${workspace.name}`} className="text-lg font-medium cursor-pointer hover:underline">
<Link to={`/${workspace.name}`} className="text-lg cursor-pointer hover:underline">
{workspace.name}
</Link>
<span className="text-sm mt-1 text-gray-600">{workspace.description}</span>
@ -28,20 +28,20 @@ const WorkspaceListView: React.FC<Props> = (props: Props) => {
<Dropdown
actions={
<>
<span
className="w-full px-2 leading-8 cursor-pointer rounded hover:bg-gray-100"
<button
className="w-full px-3 text-left leading-10 cursor-pointer rounded hover:bg-gray-100"
onClick={() => showCreateWorkspaceDialog(workspace.id)}
>
Edit
</span>
<span
className="w-full px-2 leading-8 cursor-pointer rounded text-red-600 hover:bg-gray-100"
</button>
<button
className="w-full px-3 text-left leading-10 cursor-pointer rounded text-red-600 hover:bg-gray-100"
onClick={() => {
handleDeleteWorkspaceButtonClick(workspace);
}}
>
Delete
</span>
</button>
</>
}
actionsClassName="!w-24"

View File

@ -6,6 +6,7 @@ interface Shortcut {
id: ShortcutId;
creatorId: UserId;
creator: User;
createdTs: TimeStamp;
updatedTs: TimeStamp;
workspaceId: WorkspaceId;