Skip to content

Commit 614417d

Browse files
authored
refactor: replace $tabler_icons with @preact-icons/tb icons (#967)
Removes deprecated $tabler_icons import and replaces specific Tabler icons with equivalent icons from @preact-icons/tb across multiple components and routes. Part of the icons migration proposed in #931
1 parent 1cfdb76 commit 614417d

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

frontend/components/NavOverflow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2024 the JSR authors. All rights reserved. MIT license.
2-
import IconDots from "$tabler_icons/dots.tsx";
2+
import TbDots from "@preact-icons/tb/TbDots";
33

44
const NAV_OVERFLOW_SCRIPT = /* js */ `
55
(() => {
@@ -67,7 +67,7 @@ export function NavOverflow() {
6767
aria-expanded="false"
6868
>
6969
<span class="flex p-1">
70-
<IconDots />
70+
<TbDots class="size-6" />
7171
</span>
7272
<div
7373
id="nav-menu"

frontend/deno.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"@std/semver": "jsr:@std/semver@1",
2828

2929
"twas": "npm:twas@^2.1.3",
30-
"$tabler_icons/": "https://deno.land/x/[email protected]/tsx/",
3130
"$imagescript": "https://deno.land/x/[email protected]/mod.ts",
3231

3332
"@deno/gfm": "jsr:@deno/[email protected]",

frontend/islands/UserMenu.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
// Copyright 2024 the JSR authors. All rights reserved. MIT license.
22
import { useEffect, useId, useRef, useState } from "preact/hooks";
33
import { FullUser } from "../utils/api_types.ts";
4-
import { TbLogout, TbPlus, TbUser, TbUserCog } from "@preact-icons/tb";
5-
import IconArrowRight from "$tabler_icons/arrow-right.tsx";
4+
import {
5+
TbArrowRight,
6+
TbLogout,
7+
TbPlus,
8+
TbUser,
9+
TbUserCog,
10+
} from "@preact-icons/tb";
611

712
const SHARED_ITEM_CLASSES =
813
"flex items-center justify-start gap-2 px-4 py-2.5 focus-visible:ring-2 ring-inset outline-none";
@@ -75,7 +80,7 @@ export function UserMenu({ user, sudo, logoutUrl }: {
7580
<span>
7681
{user.inviteCount} pending invite{user.inviteCount > 1 && "s"}
7782
</span>
78-
<IconArrowRight class="w-4 h-4" />
83+
<TbArrowRight class="w-4 h-4" />
7984
</a>
8085
)}
8186
{user.isStaff && (

frontend/routes/admin/scopes/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { path } from "../../../utils/api.ts";
66
import { AdminNav } from "../(_components)/AdminNav.tsx";
77
import { URLQuerySearch } from "../../../components/URLQuerySearch.tsx";
88
import { define } from "../../../util.ts";
9-
import IconArrowRight from "$tabler_icons/arrow-right.tsx";
9+
import TbArrowRight from "@preact-icons/tb/TbArrowRight";
1010

1111
export default define.page<typeof handler>(function Scopes({ data, url }) {
1212
return (
@@ -15,7 +15,7 @@ export default define.page<typeof handler>(function Scopes({ data, url }) {
1515
<div class="flex gap-4">
1616
<URLQuerySearch query={data.query} />
1717
<a class="button-primary mt-4" href="/admin/scopes/assign">
18-
Assign Scope <IconArrowRight />
18+
Assign Scope <TbArrowRight />
1919
</a>
2020
</div>
2121
<Table

frontend/routes/new.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright 2024 the JSR authors. All rights reserved. MIT license.
22
import { useSignal } from "@preact/signals";
3-
import IconFolder from "$tabler_icons/folder.tsx";
4-
import IconPackage from "$tabler_icons/package.tsx";
3+
import { TbBrandGithub, TbFolder, TbPackage } from "@preact-icons/tb";
54
import {
65
CreatePackage,
76
IconCircle,
@@ -10,7 +9,6 @@ import {
109
} from "../islands/new.tsx";
1110
import { Package, Scope } from "../utils/api_types.ts";
1211
import { path } from "../utils/api.ts";
13-
import TbBrandGithub from "@preact-icons/tb/TbBrandGithub";
1412
import { define } from "../util.ts";
1513

1614
export default define.page<typeof handler>(function New(props) {
@@ -42,7 +40,7 @@ export default define.page<typeof handler>(function New(props) {
4240
<div class="space-y-8">
4341
<div class="flex items-start gap-4">
4442
<IconCircle done={scope}>
45-
<IconFolder class="h-5 w-5" />
43+
<TbFolder class="h-5 w-5" />
4644
</IconCircle>
4745
<div class="w-full">
4846
<h2 class="font-bold text-2xl leading-none">Scope</h2>
@@ -78,7 +76,7 @@ export default define.page<typeof handler>(function New(props) {
7876
</div>
7977
<div class="flex items-start gap-4">
8078
<IconCircle done={name}>
81-
<IconPackage class="h-5 w-5" />
79+
<TbPackage class="h-5 w-5" />
8280
</IconCircle>
8381
<div class="w-full">
8482
<h2 class="font-bold text-2xl leading-none">Package name</h2>

0 commit comments

Comments
 (0)