Skip to content

Commit 179a1d3

Browse files
officeneerajsainidependabot[bot]benjagm
authored
[Fix]: Fixed Navbar dark mode navigation (#1059)
* chore(deps): bump husky from 9.1.5 to 9.1.6 (#1049) Bumps [husky](https://github.com/typicode/husky) from 9.1.5 to 9.1.6. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](typicode/husky@v9.1.5...v9.1.6) --- updated-dependencies: - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> fixed navbar dark mode navigation fixed fixed * fixed * Update package.json * Update yarn.lock * Update yarn.lock * updated file * white text in dark mode * Update next-env.d.ts * Update Layout.tsx * fixes tools page navigation active class * Update Format * Update Layout.tsx * Update tailwind.config.js --------- Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Benjamin Granados <[email protected]>
1 parent 6a20417 commit 179a1d3

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

components/Layout.tsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,18 +137,26 @@ const MainNavLink = ({
137137
className?: string;
138138
}) => {
139139
const router = useRouter();
140+
const isActiveNav = extractPathWithoutFragment(router.asPath) === uri;
141+
140142
return (
141143
<Link
142144
href={uri}
143145
className={classnames(
144146
className,
145-
'font-semibold p-2 md:p-4 dark:text-slate-300',
147+
'font-semibold p-2 md:p-4',
146148
// `${
147149
// router.asPath === uri
148150
// ? 'text-primary hover:text-primary'
149151
// : 'text-slate-600 hover:text-primary'
150152
// }`,
151-
`${extractPathWithoutFragment(router.asPath) === uri ? 'text-primary hover:text-primary' : 'text-slate-600 hover:text-primary'}`,
153+
// `${extractPathWithoutFragment(router.asPath) === uri ? 'text-primary dark:text-white dark:underline hover:text-primary' : 'text-slate-600 dark:text-white hover:text-primary dark:hover:underline'}`,
154+
{
155+
'text-primary dark:text-white dark:underline hover:text-primary':
156+
isActiveNav,
157+
'text-slate-600 dark:text-white hover:text-primary dark:hover:underline':
158+
!isActiveNav,
159+
},
152160
)}
153161
>
154162
{label}
@@ -201,7 +209,7 @@ const MainNavigation = () => {
201209

202210
<MainNavLink
203211
className='hidden lg:block hover:underline'
204-
uri='/tools'
212+
uri='/tools?query=&sortBy=name&sortOrder=ascending&groupBy=toolingTypes&licenses=&languages=&drafts=&toolingTypes=&environments='
205213
label='Tools'
206214
isActive={section === 'tools'}
207215
/>
@@ -290,7 +298,11 @@ const MobileNav = () => {
290298
isActive={section === 'docs'}
291299
/>
292300

293-
<MainNavLink uri='/tools' label='Tools' isActive={section === 'tools'} />
301+
<MainNavLink
302+
uri='/tools?query=&sortBy=name&sortOrder=ascending&groupBy=toolingTypes&licenses=&languages=&drafts=&toolingTypes=&environments='
303+
label='Tools'
304+
isActive={section === 'tools'}
305+
/>
294306
<MainNavLink uri='/blog' label='Blog' isActive={section === 'blog'} />
295307
<MainNavLink
296308
uri='/community'

styles/globals.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ border-radius: 4px; */
265265
background-color: #fddf4784;
266266
}
267267

268+
.bg-index-5 {
269+
background-color: #773cff84;
270+
}
271+
268272
@layer base {
269273
body {
270274
@apply dark:bg-slate-800 bg-white;

tailwind.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
2+
mode: 'jit', // Enable JIT mode
23
content: [
34
'./pages/**/*.{js,ts,jsx,tsx,md}',
45
'./components/**/*.{js,ts,jsx,tsx,md}',

0 commit comments

Comments
 (0)