Skip to content

Commit 736d58c

Browse files
feat: external link icons to navigation menu
1 parent a657793 commit 736d58c

File tree

6 files changed

+23
-13
lines changed

6 files changed

+23
-13
lines changed

app/tag-data.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
{
2-
"css": 1,
3-
"frontend": 1,
4-
"software-development": 2,
5-
"web-development": 1,
2+
"api": 1,
3+
"architecture": 1,
4+
"backend": 1,
5+
"database": 1,
6+
"graphql": 1,
7+
"performance": 1,
8+
"programming": 1,
9+
"rest": 1,
10+
"web-development": 2,
11+
"web-services": 1,
612
"android": 1,
713
"androidx": 1,
814
"jetifier": 1,
9-
"mobile-development": 1
15+
"mobile-development": 1,
16+
"software-development": 2,
17+
"css": 1,
18+
"frontend": 1
1019
}

components/Header.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@ const Header = () => {
5252
</div>
5353
</Link>
5454
<div className="flex items-center space-x-4 leading-5 sm:-mr-6 sm:space-x-6">
55-
<div className="no-scrollbar hidden max-w-40 items-center gap-x-4 overflow-x-auto sm:flex md:max-w-72 lg:max-w-96">
55+
<div className="no-scrollbar hidden w-full items-center gap-x-4 overflow-x-auto lg:flex">
5656
{headerNavLinks
5757
.filter((link) => link.href !== '/')
5858
.map((link) => (
5959
<Link
6060
key={link.title}
6161
href={link.href}
62-
className="flex items-center gap-1 m-1 font-medium text-gray-900 dark:text-gray-100 hover:text-primary-500 dark:hover:text-primary-400"
62+
className="hover:text-primary-500 dark:hover:text-primary-400 m-1 flex items-center gap-1 font-medium text-gray-900 dark:text-gray-100 whitespace-nowrap"
6363
>
6464
{link.title}
6565
{link.external && (
66-
<ExternalLink className="h-3 w-3 text-gray-500 dark:text-gray-400" />
66+
<ExternalLink className="h-4 w-4 text-blue-500 dark:text-blue-400" />
6767
)}
6868
</Link>
6969
))}

components/Link.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const CustomLink = ({
1010
}: LinkProps & AnchorHTMLAttributes<HTMLAnchorElement> & { external?: boolean }) => {
1111
const isInternalLink = href && href.startsWith('/')
1212
const isAnchorLink = href && href.startsWith('#')
13-
const isExternalLink = external || (href && (href.startsWith('http://') || href.startsWith('https://')))
13+
const isExternalLink =
14+
external || (href && (href.startsWith('http://') || href.startsWith('https://')))
1415

1516
if (isInternalLink) {
1617
return <Link className="break-words" href={href} {...rest} />

components/MobileNav.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const MobileNav = () => {
2929

3030
return (
3131
<>
32-
<button aria-label="Toggle Menu" onClick={onToggleNav} className="sm:hidden">
32+
<button aria-label="Toggle Menu" onClick={onToggleNav} className="lg:hidden">
3333
<svg
3434
xmlns="http://www.w3.org/2000/svg"
3535
viewBox="0 0 20 20"
@@ -77,7 +77,7 @@ const MobileNav = () => {
7777
<Link
7878
key={link.title}
7979
href={link.href}
80-
className="flex items-center gap-2 mb-4 py-2 pr-4 text-2xl font-bold tracking-widest text-gray-900 outline outline-0 dark:text-gray-100 hover:text-primary-500 dark:hover:text-primary-400"
80+
className="hover:text-primary-500 dark:hover:text-primary-400 mb-4 flex items-center gap-2 py-2 pr-4 text-2xl font-bold tracking-widest text-gray-900 outline outline-0 dark:text-gray-100"
8181
onClick={onToggleNav}
8282
>
8383
{link.title}

components/social-icons/icons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export function Instagram(svgProps: SVGProps<SVGSVGElement>) {
9696

9797
export function ExternalLink(svgProps: SVGProps<SVGSVGElement>) {
9898
return (
99-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...svgProps}>
99+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" {...svgProps}>
100100
<title>External Link</title>
101101
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14L21 3" />
102102
</svg>

data/headerNavLinks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const headerNavLinks = [
22
{ href: '/', title: 'Home' },
33
{ href: '/blog', title: 'Blog' },
4-
// { href: '/about', title: 'About' },
54
{ href: '/tags', title: 'Tags' },
5+
{ href: '/about', title: 'About' },
66
{ href: 'https://education.ditectrev.com', title: 'Education', external: true },
77
{ href: 'https://apps.apple.com/app/cloudmaster-swift/id6503601139', title: 'iOS App', external: true },
88
{ href: 'https://shop.ditectrev.com/', title: 'Shop', external: true },

0 commit comments

Comments
 (0)