-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
9715859
commit 86a4255
Showing
4 changed files
with
139 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import React from "react"; | ||
import Link from "next/link"; | ||
import { Alert, Button, Menu } from "@mantine/core"; | ||
import { Alert, Box, Burger, Button, Flex, Menu, Overlay } from "@mantine/core"; | ||
import { useDisclosure } from "@mantine/hooks"; | ||
import styled from "styled-components"; | ||
import { BiChevronDown } from "react-icons/bi"; | ||
import useUser from "src/store/useUser"; | ||
|
@@ -49,6 +50,7 @@ const Right = styled.div` | |
|
||
export const Navbar = () => { | ||
const isAuthenticated = useUser(state => state.isAuthenticated); | ||
const [opened, { toggle }] = useDisclosure(); | ||
|
||
return ( | ||
<StyledNavbarWrapper> | ||
|
@@ -62,6 +64,7 @@ export const Navbar = () => { | |
variant="subtle" | ||
color="black" | ||
radius="md" | ||
visibleFrom="md" | ||
> | ||
Pricing | ||
</Button> | ||
|
@@ -72,6 +75,7 @@ export const Navbar = () => { | |
variant="subtle" | ||
color="black" | ||
radius="md" | ||
visibleFrom="md" | ||
> | ||
VS Code | ||
</Button> | ||
|
@@ -82,16 +86,18 @@ export const Navbar = () => { | |
variant="subtle" | ||
color="black" | ||
radius="md" | ||
visibleFrom="md" | ||
> | ||
Docs | ||
</Button> | ||
<Menu trigger="hover" offset={15} withArrow> | ||
<Menu trigger="hover" offset={15} withArrow shadow="md"> | ||
<Menu.Target> | ||
<Button | ||
variant="subtle" | ||
color="black" | ||
radius="md" | ||
rightSection={<BiChevronDown size="18" />} | ||
visibleFrom="md" | ||
> | ||
Legal | ||
</Button> | ||
|
@@ -112,13 +118,14 @@ export const Navbar = () => { | |
</Menu.Item> | ||
</Menu.Dropdown> | ||
</Menu> | ||
<Menu trigger="hover" offset={15} withArrow> | ||
<Menu trigger="hover" offset={15} withArrow shadow="md"> | ||
<Menu.Target> | ||
<Button | ||
variant="subtle" | ||
color="black" | ||
radius="md" | ||
rightSection={<BiChevronDown size="18" />} | ||
visibleFrom="md" | ||
> | ||
Social | ||
</Button> | ||
|
@@ -147,18 +154,125 @@ export const Navbar = () => { | |
variant="outline" | ||
color="dark" | ||
className="hide-mobile" | ||
visibleFrom="md" | ||
> | ||
Login | ||
</Button> | ||
)} | ||
<Button color="dark" component={Link} href="/editor" prefetch={false}> | ||
<Button color="dark" component={Link} href="/editor" prefetch={false} visibleFrom="md"> | ||
Editor | ||
</Button> | ||
<Burger opened={opened} onClick={toggle} aria-label="Toggle navigation" hiddenFrom="md" /> | ||
{opened && ( | ||
<Overlay top={56} h="100dvh"> | ||
<Box | ||
bg="white" | ||
top={56} | ||
left={0} | ||
pos="fixed" | ||
w="100%" | ||
pb="lg" | ||
style={{ zIndex: 3, borderBottom: "1px solid black" }} | ||
> | ||
<Flex pt="lg" direction="column" align="center" justify="center" gap="lg"> | ||
<Button | ||
component={Link} | ||
href="/pricing" | ||
variant="transparent" | ||
color="black" | ||
radius="md" | ||
onClick={toggle} | ||
> | ||
Pricing | ||
</Button> | ||
<Button | ||
component="a" | ||
href="https://marketplace.visualstudio.com/items?itemName=AykutSarac.jsoncrack-vscode" | ||
target="_blank" | ||
variant="transparent" | ||
color="black" | ||
radius="md" | ||
onClick={toggle} | ||
> | ||
VS Code | ||
</Button> | ||
<Button | ||
component={Link} | ||
href="/docs" | ||
prefetch={false} | ||
variant="transparent" | ||
color="black" | ||
radius="md" | ||
onClick={toggle} | ||
> | ||
Docs | ||
</Button> | ||
<Menu trigger="click" offset={15} withArrow shadow="md"> | ||
<Menu.Target> | ||
<Button | ||
variant="transparent" | ||
color="black" | ||
radius="md" | ||
rightSection={<BiChevronDown size="18" />} | ||
> | ||
Legal | ||
</Button> | ||
</Menu.Target> | ||
<Menu.Dropdown> | ||
<Menu.Item component={Link} href="/legal/privacy" prefetch={false}> | ||
Privacy Policy | ||
</Menu.Item> | ||
<Menu.Item component={Link} href="/legal/terms" prefetch={false}> | ||
Terms and Conditions | ||
</Menu.Item> | ||
<Menu.Item | ||
component={Link} | ||
href="/legal/subscription-refund" | ||
prefetch={false} | ||
> | ||
Subscription | ||
</Menu.Item> | ||
<Menu.Divider /> | ||
<Menu.Item component="a" href="mailto:[email protected]"> | ||
[email protected] | ||
</Menu.Item> | ||
</Menu.Dropdown> | ||
</Menu> | ||
<Menu trigger="click" offset={15} withArrow shadow="md"> | ||
<Menu.Target> | ||
<Button | ||
variant="transparent" | ||
color="black" | ||
radius="md" | ||
rightSection={<BiChevronDown size="18" />} | ||
> | ||
Social | ||
</Button> | ||
</Menu.Target> | ||
<Menu.Dropdown> | ||
<Menu.Item component="a" href="https://twitter.com/jsoncrack"> | ||
𝕏 (Twitter) | ||
</Menu.Item> | ||
<Menu.Item component="a" href="https://discord.gg/yVyTtCRueq"> | ||
Discord | ||
</Menu.Item> | ||
<Menu.Item component="a" href="https://www.linkedin.com/company/herowand"> | ||
</Menu.Item> | ||
<Menu.Item component="a" href="https://github.com/AykutSarac/jsoncrack.com"> | ||
GitHub | ||
</Menu.Item> | ||
</Menu.Dropdown> | ||
</Menu> | ||
</Flex> | ||
</Box> | ||
</Overlay> | ||
)} | ||
</Right> | ||
</StyledNavbar> | ||
<Link href="/pricing"> | ||
<Alert color="red" variant="filled" radius={0} fw="bold"> | ||
Unlock premium features now with 30% discount on the Premium plan! | ||
Unlock premium features now with ~30% discount on the Premium plan! | ||
</Alert> | ||
</Link> | ||
</StyledNavbarWrapper> | ||
|
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