-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
023b713
commit ae71d22
Showing
8 changed files
with
68 additions
and
30 deletions.
There are no files selected for viewing
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,24 @@ | ||
import React from "react"; | ||
import clsx from "clsx"; | ||
import Link, { Props } from "@docusaurus/Link"; | ||
|
||
type ButtonProps = Props & { | ||
variant: "primary" | "secondary"; | ||
}; | ||
|
||
export default function Button({ children, variant, ...rest }: ButtonProps) { | ||
return ( | ||
<Link | ||
{...rest} | ||
className={clsx( | ||
"border font-semibold text-white h-12 px-6 flex items-center hover:no-underline transition-colors", | ||
variant === "primary" && | ||
"bg-primary-base hover:bg-primary-hover border-primary-base hover:border-primary-hover hover:text-white", | ||
variant === "secondary" && | ||
"border-gray-700 bg-transparent hover:border-white hover:text-white" | ||
)} | ||
> | ||
{children} | ||
</Link> | ||
); | ||
} |
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,18 @@ | ||
import React from "react"; | ||
import Button from "../Button"; | ||
|
||
type ButtonNavbarItemProps = { | ||
label: string; | ||
href: string; | ||
}; | ||
|
||
export default function ButtonNavbarItem({ | ||
label, | ||
href, | ||
}: ButtonNavbarItemProps) { | ||
return ( | ||
<Button variant="primary" href={href}> | ||
{label} | ||
</Button> | ||
); | ||
} |
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,7 +1,10 @@ | ||
import ComponentTypes from "@theme-original/NavbarItem/ComponentTypes"; | ||
import GitHubStarsNavbarItem from "@site/src/components/GitHubStarsNavbarItem"; | ||
|
||
import ButtonNavbarItem from "@site/src/components/ButtonNavbarItem"; | ||
|
||
export default { | ||
...ComponentTypes, | ||
"custom-github-stars-navbar-item": GitHubStarsNavbarItem, | ||
"custom-button-navbar-item": ButtonNavbarItem, | ||
}; |
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