mirror of
https://github.com/aykhans/slash-e.git
synced 2025-09-07 17:50:44 +00:00
chore: update dropdown component
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { shortcutService } from "../services";
|
||||
import Dropdown from "./common/Dropdown";
|
||||
import showCreateShortcutDialog from "./CreateShortcutDialog";
|
||||
import Icon from "./Icon";
|
||||
|
||||
interface Props {
|
||||
workspaceId: WorkspaceId;
|
||||
@@ -21,24 +22,30 @@ const ShortcutListView: React.FC<Props> = (props: Props) => {
|
||||
<div key={shortcut.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">
|
||||
<span className="text-lg font-medium">{shortcut.name}</span>
|
||||
<span className="text-base text-gray-600">{shortcut.link}</span>
|
||||
<a className="text-base text-gray-600 flex flex-row cursor-pointer hover:underline" target="blank" href={shortcut.link}>
|
||||
{shortcut.link} <Icon.ExternalLink className="w-4 h-auto ml-1" />
|
||||
</a>
|
||||
</div>
|
||||
<Dropdown>
|
||||
<span
|
||||
className="w-full px-2 leading-8 cursor-pointer rounded hover:bg-gray-100"
|
||||
onClick={() => showCreateShortcutDialog(workspaceId, shortcut.id)}
|
||||
>
|
||||
Edit
|
||||
</span>
|
||||
<span
|
||||
className="w-full px-2 leading-8 cursor-pointer rounded text-red-600 hover:bg-gray-100"
|
||||
onClick={() => {
|
||||
handleDeleteShortcutButtonClick(shortcut);
|
||||
}}
|
||||
>
|
||||
Delete
|
||||
</span>
|
||||
</Dropdown>
|
||||
<Dropdown
|
||||
actions={
|
||||
<>
|
||||
<span
|
||||
className="w-full px-2 leading-8 cursor-pointer rounded hover:bg-gray-100"
|
||||
onClick={() => showCreateShortcutDialog(workspaceId, shortcut.id)}
|
||||
>
|
||||
Edit
|
||||
</span>
|
||||
<span
|
||||
className="w-full px-2 leading-8 cursor-pointer rounded text-red-600 hover:bg-gray-100"
|
||||
onClick={() => {
|
||||
handleDeleteShortcutButtonClick(shortcut);
|
||||
}}
|
||||
>
|
||||
Delete
|
||||
</span>
|
||||
</>
|
||||
}
|
||||
></Dropdown>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
|
Reference in New Issue
Block a user