Skip to content

Commit a0e8466

Browse files
committed
add BrandXIcon and BSkyIcon components; update Navbar to use new icons
1 parent e077daf commit a0e8466

File tree

4 files changed

+77
-22
lines changed

4 files changed

+77
-22
lines changed

src/components/Navbar.tsx

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as React from 'react'
22
import { twMerge } from 'tailwind-merge'
33
import { BrandContextMenu } from './BrandContextMenu'
44
import { Link, useLocation, useMatches } from '@tanstack/react-router'
5-
import { TbBrandX, TbBrandBesky } from 'react-icons/tb'
65
import {
76
Code,
87
Users,
@@ -33,6 +32,8 @@ import { useCapabilities } from '~/hooks/useCapabilities'
3332
import { GithubIcon } from '~/components/icons/GithubIcon'
3433
import { DiscordIcon } from '~/components/icons/DiscordIcon'
3534
import { InstagramIcon } from '~/components/icons/InstagramIcon'
35+
import { BSkyIcon } from '~/components/icons/BSkyIcon'
36+
import { BrandXIcon } from '~/components/icons/BrandXIcon'
3637

3738
export function Navbar({ children }: { children: React.ReactNode }) {
3839
const matches = useMatches()
@@ -42,7 +43,7 @@ export function Navbar({ children }: { children: React.ReactNode }) {
4243
[...matches].reverse().find((m) => m.staticData.Title)?.staticData.Title ??
4344
null
4445

45-
const canAdmin = capabilities.incdes('admin')
46+
const canAdmin = capabilities.includes('admin')
4647

4748
const containerRef = React.useRef<HTMLDivElement>(null)
4849

@@ -80,7 +81,7 @@ export function Navbar({ children }: { children: React.ReactNode }) {
8081
className="flex items-center gap-1 bg-gray-500/20 rounded-lg p-2 opacity-80
8182
hover:opacity-100 whitespace-nowrap uppercase font-black text-xs"
8283
>
83-
<User className="scale-125" />
84+
<User size={16} />
8485
<div className="">Log In</div>
8586
</Link>
8687
)
@@ -127,14 +128,14 @@ export function Navbar({ children }: { children: React.ReactNode }) {
127128
className="opacity-70 hover:opacity-100"
128129
aria-label="Follow TanStack on X.com"
129130
>
130-
<TbBrandX className="text-xl" />
131+
<BrandXIcon className="text-xl" />
131132
</a>
132133
<a
133134
href="https://bsky.app/profile/tanstack.com"
134135
className="opacity-70 hover:opacity-100"
135136
aria-label="Follow TanStack on Besky"
136137
>
137-
<TbBrandBesky className="text-xl" />
138+
<BSkyIcon className="text-xl" />
138139
</a>
139140
<a
140141
href="https://instagram.com/tan_stack"
@@ -268,7 +269,7 @@ export function Navbar({ children }: { children: React.ReactNode }) {
268269
textStyle: string
269270
badge?: string
270271
colorFrom: string
271-
} => d.to !== undefined && sidebarLibraryIds.incdes(d.id),
272+
} => d.to !== undefined && sidebarLibraryIds.includes(d.id),
272273
)
273274
.sort((a, b) => {
274275
const indexA = sidebarLibraryIds.indexOf(a.id)
@@ -418,7 +419,7 @@ export function Navbar({ children }: { children: React.ReactNode }) {
418419
<div>
419420
<Authenticated>
420421
{capabilities.some((capability) =>
421-
(['builder', 'admin'] as const).incdes(
422+
(['builder', 'admin'] as const).includes(
422423
capability as 'builder' | 'admin',
423424
),
424425
) ? (
@@ -450,22 +451,22 @@ export function Navbar({ children }: { children: React.ReactNode }) {
450451
</span>
451452
</>
452453
),
453-
icon: <Rss />,
454+
icon: <Rss size={14} />,
454455
to: '/feed',
455456
},
456457
{
457458
label: 'Maintainers',
458-
icon: <Code />,
459+
icon: <Code size={14} />,
459460
to: '/maintainers',
460461
},
461462
{
462463
label: 'Partners',
463-
icon: <Users />,
464+
icon: <Users size={14} />,
464465
to: '/partners',
465466
},
466467
{
467468
label: 'Blog',
468-
icon: <Music />,
469+
icon: <Music size={14} />,
469470
to: '/blog',
470471
},
471472
{
@@ -477,28 +478,28 @@ export function Navbar({ children }: { children: React.ReactNode }) {
477478
</span>
478479
</>
479480
),
480-
icon: <BookOpen />,
481+
icon: <BookOpen size={14} />,
481482
to: '/learn',
482483
},
483484
{
484485
label: 'Support',
485-
icon: <HelpCircle />,
486+
icon: <HelpCircle size={14} />,
486487
to: '/support',
487488
},
488489
{
489490
label: 'Stats',
490-
icon: <TrendingUp />,
491+
icon: <TrendingUp size={14} />,
491492
to: '/stats/npm',
492493
},
493494
{
494495
label: 'Discord',
495-
icon: <DiscordIcon />,
496+
icon: <DiscordIcon size={14} />,
496497
to: 'https://tlinz.com/discord',
497498
target: '_blank',
498499
},
499500
{
500501
label: 'Merch',
501-
icon: <Shirt />,
502+
icon: <Shirt size={14} />,
502503
to: '/merch',
503504
},
504505
{
@@ -508,26 +509,26 @@ export function Navbar({ children }: { children: React.ReactNode }) {
508509
},
509510
{
510511
label: 'Ethos',
511-
icon: <ShieldCheck />,
512+
icon: <ShieldCheck size={14} />,
512513
to: '/ethos',
513514
},
514515
{
515516
label: 'Tenets',
516-
icon: <BookOpen />,
517+
icon: <BookOpen size={14} />,
517518
to: '/tenets',
518519
},
519520
{
520521
label: 'Brand Guide',
521-
icon: <Paintbrush />,
522+
icon: <Paintbrush size={14} />,
522523
to: '/brand-guide',
523524
},
524525
]
525526
.filter((item) => {
526527
// Filter out items that require capabilities the user doesn't have
527528
if (item.requiresCapability) {
528529
return (
529-
capabilities.incdes(item.requiresCapability) ||
530-
capabilities.incdes('admin')
530+
capabilities.includes(item.requiresCapability) ||
531+
capabilities.includes('admin')
531532
)
532533
}
533534
return true

src/components/SearchButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function SearchButton({ className }: SearchButtonProps) {
2424
<MdSearch className="text-lg" /> Search...
2525
</div>
2626
<div className="flex items-center bg-white/50 dark:bg-gray-500/50 rounded-md px-2 py-1 gap-1 font-bold text-xs whitespace-nowrap">
27-
<Command size={14} /> + K
27+
<Command size={12} /> + K
2828
</div>
2929
</button>
3030
)

src/components/icons/BSkyIcon.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import * as React from 'react'
2+
3+
export function BSkyIcon({
4+
className,
5+
width = '1em',
6+
height = '1em',
7+
...props
8+
}: React.SVGProps<SVGSVGElement>) {
9+
return (
10+
<svg
11+
viewBox="0 0 24 24"
12+
fill="none"
13+
stroke="currentColor"
14+
strokeWidth={2}
15+
strokeLinecap="round"
16+
strokeLinejoin="round"
17+
width={width}
18+
height={height}
19+
role="img"
20+
aria-hidden={props['aria-label'] ? undefined : true}
21+
className={className}
22+
{...props}
23+
>
24+
<path d="M6.335 5.144c-1.654 -1.199 -4.335 -2.127 -4.335 .826c0 .59 .35 4.953 .556 5.661c.713 2.463 3.13 2.75 5.444 2.369c-4.045 .665 -4.889 3.208 -2.667 5.41c1.03 1.018 1.913 1.59 2.667 1.59c2 0 3.134 -2.769 3.5 -3.5c.333 -.667 .5 -1.167 .5 -1.5c0 .333 .167 .833 .5 1.5c.366 .731 1.5 3.5 3.5 3.5c.754 0 1.637 -.571 2.667 -1.59c2.222 -2.203 1.378 -4.746 -2.667 -5.41c2.314 .38 4.73 .094 5.444 -2.369c.206 -.708 .556 -5.072 .556 -5.661c0 -2.953 -2.68 -2.025 -4.335 -.826c-2.293 1.662 -4.76 5.048 -5.665 6.856c-.905 -1.808 -3.372 -5.194 -5.665 -6.856z"></path>
25+
</svg>
26+
)
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import * as React from 'react'
2+
3+
export function BrandXIcon({
4+
className,
5+
width = '1em',
6+
height = '1em',
7+
...props
8+
}: React.SVGProps<SVGSVGElement>) {
9+
return (
10+
<svg
11+
viewBox="0 0 24 24"
12+
fill="none"
13+
stroke="currentColor"
14+
strokeWidth={2}
15+
strokeLinecap="round"
16+
strokeLinejoin="round"
17+
width={width}
18+
height={height}
19+
role="img"
20+
aria-hidden={props['aria-label'] ? undefined : true}
21+
className={className}
22+
{...props}
23+
>
24+
<path d="M4 4l11.733 16h4.267l-11.733 -16z"></path><path d="M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"></path>
25+
</svg>
26+
)
27+
}

0 commit comments

Comments
 (0)