Skip to content

Commit

Permalink
refactor: change toast icons
Browse files Browse the repository at this point in the history
  • Loading branch information
divyam234 committed Oct 18, 2024
1 parent 2f3a9fb commit f58d270
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 17 deletions.
20 changes: 10 additions & 10 deletions ui/components/list/btsearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,16 @@ const ControlDropdown = () => {
}}
onAction={onAction}
>
<DropdownItem key="link" startContent={<Icons.ExternalLink />}>
<a
rel="noopener noreferrer"
target="_blank"
className="no-underline block"
href={item?.link}
>
Open Link
</a>
</DropdownItem>
<DropdownItem key="add" startContent={<Icons.CirclePlus />}>
Add Torrent
</DropdownItem>
Expand All @@ -129,16 +139,6 @@ const ControlDropdown = () => {
Open Magnet
</a>
</DropdownItem>
<DropdownItem key="link" startContent={<Icons.ExternalLink />}>
<a
rel="noopener noreferrer"
target="_blank"
className="no-underline block"
href={item?.link}
>
Open Link
</a>
</DropdownItem>
</DropdownMenu>
</Dropdown>
);
Expand Down
11 changes: 4 additions & 7 deletions ui/components/list/download.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,10 @@ const DownloadDropdown = () => {
Play
</Link>
</DropdownItem>
<DropdownItem
download
href={item.download}
key="download"
startContent={<Icons.Download />}
>
Download
<DropdownItem key="download" startContent={<Icons.Download />}>
<a rel="noopener noreferrer" className="no-underline block" href={item.download}>
Download
</a>
</DropdownItem>
<DropdownItem key="delete" startContent={<Icons.Delete />}>
Delete
Expand Down
7 changes: 7 additions & 0 deletions ui/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Toaster } from "react-hot-toast";
import { routeTree } from "./route-tree.gen";

import "./styles/globals.css";
import { Icons } from "./utils/icons";

const router = createRouter({
routeTree,
Expand Down Expand Up @@ -39,6 +40,12 @@ if (!rootElement.innerHTML) {
position="bottom-right"
toastOptions={{
className: "!bg-radial-1 !bg-background !text-foreground shadow-medium min-w-[220px]",
success: {
icon: <Icons.CheckCircle className="text-success" />,
},
error: {
icon: <Icons.AlertCircleFilled className="text-danger" />,
},
}}
/>
<RouterProvider router={router} />
Expand Down
2 changes: 2 additions & 0 deletions ui/utils/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import IcRoundRefresh from "~icons/ic/round-refresh";
import TablerCirclePlusFilled from "~icons/tabler/circle-plus-filled";
import TablerCirclePlus from "~icons/tabler/circle-plus";
import TablerZoomCheck from "~icons/tabler/zoom-check";
import TablerAlertCircleFilled from "~icons/tabler/alert-circle-filled";

export const Icons = {
HomeOutline: TablerHome,
Expand Down Expand Up @@ -81,4 +82,5 @@ export const Icons = {
CirclePlusFilled: TablerCirclePlusFilled,
CirclePlus: TablerCirclePlus,
CheckZoom: TablerZoomCheck,
AlertCircleFilled: TablerAlertCircleFilled,
};

0 comments on commit f58d270

Please sign in to comment.