Skip to content

Commit

Permalink
feat: add open-all-shortcuts button to collection (#117)
Browse files Browse the repository at this point in the history
In /collection view, next to "Share" button, adds an "ArrowUpRight" button that opens all shortcuts in collection on click.
  • Loading branch information
FjellOverflow committed May 9, 2024
1 parent cd45d5a commit 3ef8b78
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions frontend/web/src/components/CollectionView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ const CollectionView = (props: Props) => {
navigateTo(`/shortcut/${shortcut.id}`);
};

const handleOpenAllShortcutsButtonClick = () => {
shortcuts.forEach((shortcut: Shortcut) => window.open(`/s/${shortcut.name}`));
};

return (
<>
<div className={classNames("w-full flex flex-col justify-start items-start border rounded-lg hover:shadow dark:border-zinc-800")}>
Expand All @@ -74,6 +78,9 @@ const CollectionView = (props: Props) => {
<Link className="w-full text-gray-400 cursor-pointer hover:text-gray-500" to={`/c/${collection.name}`} target="_blank">
<Icon.Share className="w-4 h-auto" />
</Link>
<button className="w-full text-gray-400 cursor-pointer hover:text-gray-500" onClick={() => handleOpenAllShortcutsButtonClick()}>
<Icon.ArrowUpRight className="w-4 h-auto" />
</button>
{showAdminActions && (
<Dropdown
trigger={
Expand Down

0 comments on commit 3ef8b78

Please sign in to comment.