Skip to content

Commit

Permalink
[Fix]: Fixed Navbar dark mode navigation (#1059)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people authored Dec 21, 2024
1 parent 6a20417 commit 179a1d3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
20 changes: 16 additions & 4 deletions components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,26 @@ const MainNavLink = ({
className?: string;
}) => {
const router = useRouter();
const isActiveNav = extractPathWithoutFragment(router.asPath) === uri;

return (
<Link
href={uri}
className={classnames(
className,
'font-semibold p-2 md:p-4 dark:text-slate-300',
'font-semibold p-2 md:p-4',
// `${
// router.asPath === uri
// ? 'text-primary hover:text-primary'
// : 'text-slate-600 hover:text-primary'
// }`,
`${extractPathWithoutFragment(router.asPath) === uri ? 'text-primary hover:text-primary' : 'text-slate-600 hover:text-primary'}`,
// `${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'}`,
{
'text-primary dark:text-white dark:underline hover:text-primary':
isActiveNav,
'text-slate-600 dark:text-white hover:text-primary dark:hover:underline':
!isActiveNav,
},
)}
>
{label}
Expand Down Expand Up @@ -201,7 +209,7 @@ const MainNavigation = () => {

<MainNavLink
className='hidden lg:block hover:underline'
uri='/tools'
uri='/tools?query=&sortBy=name&sortOrder=ascending&groupBy=toolingTypes&licenses=&languages=&drafts=&toolingTypes=&environments='
label='Tools'
isActive={section === 'tools'}
/>
Expand Down Expand Up @@ -290,7 +298,11 @@ const MobileNav = () => {
isActive={section === 'docs'}
/>

<MainNavLink uri='/tools' label='Tools' isActive={section === 'tools'} />
<MainNavLink
uri='/tools?query=&sortBy=name&sortOrder=ascending&groupBy=toolingTypes&licenses=&languages=&drafts=&toolingTypes=&environments='
label='Tools'
isActive={section === 'tools'}
/>
<MainNavLink uri='/blog' label='Blog' isActive={section === 'blog'} />
<MainNavLink
uri='/community'
Expand Down
4 changes: 4 additions & 0 deletions styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ border-radius: 4px; */
background-color: #fddf4784;
}

.bg-index-5 {
background-color: #773cff84;
}

@layer base {
body {
@apply dark:bg-slate-800 bg-white;
Expand Down
1 change: 1 addition & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
mode: 'jit', // Enable JIT mode
content: [
'./pages/**/*.{js,ts,jsx,tsx,md}',
'./components/**/*.{js,ts,jsx,tsx,md}',
Expand Down

0 comments on commit 179a1d3

Please sign in to comment.