generated from chibat/chrome-extension-typescript-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finished header for now and cleaned up and refactored
- Loading branch information
1 parent
b5c8a2e
commit 5753591
Showing
52 changed files
with
535 additions
and
198 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import type{ Blog } from "@/types/blog"; | ||
import type{ Blog } from "~types/blog"; | ||
|
||
const BlogData: Blog[] = [ | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import type { FAQ } from "@/types/faq"; | ||
import type { FAQ } from "~types/faq"; | ||
|
||
const faqData: FAQ[] = [ | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
import Link from "next/link"; | ||
import { forwardRef, type ComponentPropsWithRef } from "react"; | ||
import { twMerge } from "tailwind-merge"; | ||
|
||
export interface NavLinkProps extends ComponentPropsWithRef<"a"> { | ||
isActive?: boolean; | ||
id?: string; | ||
} | ||
|
||
const NavLink = forwardRef<HTMLAnchorElement, NavLinkProps>((props, ref) => { | ||
const { href, type, isActive, className, ...rest } = props; | ||
const activeClassName = isActive ? "text-blue-500 dark:text-blue-400" : ""; | ||
|
||
return ( | ||
<Link | ||
href={href} | ||
ref={ref} | ||
className={twMerge( | ||
"block px-4 py-2 rounded-md font-medium text-gray-700 hover:text-gray-900 dark:text-gray-300 dark:hover:text-gray-100", | ||
activeClassName, | ||
className | ||
)} | ||
{...rest} | ||
/> | ||
); | ||
}); | ||
|
||
NavLink.displayName = "NavLink"; | ||
export default NavLink; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React, { useRef } from "react"; | ||
import { usePathname } from "next/navigation"; | ||
// import siteConfig from "data/config"; | ||
import { useScrollSpy } from "~hooks/use-scrollspy"; | ||
// import ThemeToggle from "./theme-toggle"; | ||
// import MobileNavButton from "components/mobile-nav/MobileNavButton"; | ||
// import MobileNavContent from "components/mobile-nav/MobileNavContent"; | ||
import NavLink from "./NavLink"; | ||
import { headerRoutes } from "~config/header"; | ||
|
||
const Navigation = () => { | ||
const pathname = usePathname(); | ||
// const activeId = useScrollSpy( | ||
// headerRoutes.filter(({ path }) => path).map(({ path }) => `#${path}`), | ||
// { | ||
// threshold: 0.75, | ||
// } | ||
// ); | ||
|
||
const mobileNavBtnRef = useRef(null); | ||
|
||
return ( | ||
<div className="flex space-x-2"> | ||
{headerRoutes.map(({ path, id, ...props }, i) => ( | ||
<NavLink | ||
key={i} | ||
href={path || "/"} | ||
// isActive={(path && pathname.startsWith(path)) || pathname === path} | ||
{...props} | ||
> | ||
{props.title} | ||
</NavLink> | ||
))} | ||
|
||
{/* <ThemeToggle /> */} | ||
|
||
{/* <MobileNavButton | ||
ref={mobileNavBtnRef} | ||
aria-label="Open Menu" | ||
onClick={MobileNavButton.onClick} | ||
/> | ||
<MobileNavContent | ||
isOpen={MobileNavContent.isOpen} | ||
onClose={MobileNavContent.onClose} | ||
/> */} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Navigation; |
Oops, something went wrong.