Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 17c046b

Browse files
committedJun 4, 2023
Merge remote-tracking branch 'origin/main' into translate-useeffect
2 parents 76b66c6 + 3fd67f8 commit 17c046b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+494
-391
lines changed
 

‎src/components/Layout/Sidebar/SidebarLink.tsx

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -49,44 +49,43 @@ export function SidebarLink({
4949
target = '_blank';
5050
}
5151
return (
52-
<Link href={href}>
53-
<a
54-
ref={ref}
55-
title={title}
56-
target={target}
57-
aria-current={selected ? 'page' : undefined}
58-
className={cn(
59-
'p-2 pr-2 w-full rounded-none lg:rounded-r-2xl text-left hover:bg-gray-5 dark:hover:bg-gray-80 relative flex items-center justify-between',
60-
{
61-
'text-sm pl-6': level > 0,
62-
'pl-5': level < 2,
63-
'text-base font-bold': level === 0,
64-
'text-primary dark:text-primary-dark': level === 0 && !selected,
65-
'text-base text-secondary dark:text-secondary-dark':
66-
level > 0 && !selected,
67-
'text-base text-link dark:text-link-dark bg-highlight dark:bg-highlight-dark border-blue-40 hover:bg-highlight hover:text-link dark:hover:bg-highlight-dark dark:hover:text-link-dark':
68-
selected,
69-
'dark:bg-gray-70 bg-gray-3 dark:hover:bg-gray-70 hover:bg-gray-3':
70-
isPending,
71-
}
72-
)}>
73-
{/* This here needs to be refactored ofc */}
52+
<Link
53+
href={href}
54+
ref={ref}
55+
title={title}
56+
target={target}
57+
aria-current={selected ? 'page' : undefined}
58+
className={cn(
59+
'p-2 pr-2 w-full rounded-none lg:rounded-r-2xl text-left hover:bg-gray-5 dark:hover:bg-gray-80 relative flex items-center justify-between',
60+
{
61+
'text-sm pl-6': level > 0,
62+
'pl-5': level < 2,
63+
'text-base font-bold': level === 0,
64+
'text-primary dark:text-primary-dark': level === 0 && !selected,
65+
'text-base text-secondary dark:text-secondary-dark':
66+
level > 0 && !selected,
67+
'text-base text-link dark:text-link-dark bg-highlight dark:bg-highlight-dark border-blue-40 hover:bg-highlight hover:text-link dark:hover:bg-highlight-dark dark:hover:text-link-dark':
68+
selected,
69+
'dark:bg-gray-70 bg-gray-3 dark:hover:bg-gray-70 hover:bg-gray-3':
70+
isPending,
71+
}
72+
)}>
73+
{/* This here needs to be refactored ofc */}
74+
<span
75+
className={cn({
76+
'text-gray-400 dark:text-gray-500': wip,
77+
})}>
78+
{title}
79+
</span>
80+
{isExpanded != null && !hideArrow && (
7481
<span
75-
className={cn({
76-
'text-gray-400 dark:text-gray-500': wip,
82+
className={cn('pr-1', {
83+
'text-link dark:text-link-dark': isExpanded,
84+
'text-tertiary dark:text-tertiary-dark': !isExpanded,
7785
})}>
78-
{title}
86+
<IconNavArrow displayDirection={isExpanded ? 'down' : 'right'} />
7987
</span>
80-
{isExpanded != null && !hideArrow && (
81-
<span
82-
className={cn('pr-1', {
83-
'text-link dark:text-link-dark': isExpanded,
84-
'text-tertiary dark:text-tertiary-dark': !isExpanded,
85-
})}>
86-
<IconNavArrow displayDirection={isExpanded ? 'down' : 'right'} />
87-
</span>
88-
)}
89-
</a>
88+
)}
9089
</Link>
9190
);
9291
}

‎src/components/Layout/TopNav/TopNav.tsx

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,17 @@ const githubIcon = (
9090
</svg>
9191
);
9292

93-
function Link({href, children, ...props}: JSX.IntrinsicElements['a']) {
93+
function Link({
94+
href,
95+
children,
96+
...props
97+
}: React.AnchorHTMLAttributes<HTMLAnchorElement>) {
9498
return (
95-
<NextLink href={`${href}`}>
96-
{/* eslint-disable-next-line jsx-a11y/anchor-has-content */}
97-
<a
98-
className="inline text-primary dark:text-primary-dark hover:text-link hover:dark:text-link-dark border-b border-link border-opacity-0 hover:border-opacity-100 duration-100 ease-in transition leading-normal"
99-
{...props}>
100-
{children}
101-
</a>
99+
<NextLink
100+
href={`${href}`}
101+
className="inline text-primary dark:text-primary-dark hover:text-link hover:dark:text-link-dark border-b border-link border-opacity-0 hover:border-opacity-100 duration-100 ease-in transition leading-normal"
102+
{...props}>
103+
{children}
102104
</NextLink>
103105
);
104106
}
@@ -247,16 +249,15 @@ export default function TopNav({
247249
{isOpen ? <IconClose /> : <IconHamburger />}
248250
</button>
249251
<div className="3xl:flex-1 flex align-center">
250-
<NextLink href="/">
251-
<a
252-
className={`active:scale-95 overflow-hidden transition-transform relative items-center text-primary dark:text-primary-dark p-1 whitespace-nowrap outline-link rounded-full 3xl:rounded-xl inline-flex text-lg font-normal gap-2`}>
253-
<Logo
254-
className={cn(
255-
'text-sm mr-0 w-10 h-10 text-link dark:text-link-dark flex origin-center transition-all ease-in-out'
256-
)}
257-
/>
258-
<span className="sr-only 3xl:not-sr-only">React</span>
259-
</a>
252+
<NextLink
253+
href="/"
254+
className={`active:scale-95 overflow-hidden transition-transform relative items-center text-primary dark:text-primary-dark p-1 whitespace-nowrap outline-link rounded-full 3xl:rounded-xl inline-flex text-lg font-normal gap-2`}>
255+
<Logo
256+
className={cn(
257+
'text-sm mr-0 w-10 h-10 text-link dark:text-link-dark flex origin-center transition-all ease-in-out'
258+
)}
259+
/>
260+
<span className="sr-only 3xl:not-sr-only">React</span>
260261
</NextLink>
261262
</div>
262263
</div>
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.