From 86a4255b6d5be06e66d4ec74f90e5a900607ba5f Mon Sep 17 00:00:00 2001 From: AykutSarac Date: Wed, 3 Jan 2024 18:30:40 +0300 Subject: [PATCH] fix: responsive navbar --- src/layout/Navbar/index.tsx | 124 ++++++++++++++++++++++++++++++++++-- src/pages/docs.tsx | 15 ++--- src/pages/index.tsx | 5 -- src/pages/pricing.tsx | 19 ++++-- 4 files changed, 139 insertions(+), 24 deletions(-) diff --git a/src/layout/Navbar/index.tsx b/src/layout/Navbar/index.tsx index 2e4eb2cfc6d..e180d7fe1aa 100644 --- a/src/layout/Navbar/index.tsx +++ b/src/layout/Navbar/index.tsx @@ -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 ( @@ -62,6 +64,7 @@ export const Navbar = () => { variant="subtle" color="black" radius="md" + visibleFrom="md" > Pricing @@ -72,6 +75,7 @@ export const Navbar = () => { variant="subtle" color="black" radius="md" + visibleFrom="md" > VS Code @@ -82,16 +86,18 @@ export const Navbar = () => { variant="subtle" color="black" radius="md" + visibleFrom="md" > Docs - + @@ -112,13 +118,14 @@ export const Navbar = () => { - + @@ -147,18 +154,125 @@ export const Navbar = () => { variant="outline" color="dark" className="hide-mobile" + visibleFrom="md" > Login )} - + + {opened && ( + + + + + + + + + + + + + Privacy Policy + + + Terms and Conditions + + + Subscription + + + + contact@jsoncrack.com + + + + + + + + + + 𝕏 (Twitter) + + + Discord + + + LinkedIn + + + GitHub + + + + + + + )} - Unlock premium features now with 30% discount on the Premium plan! + Unlock premium features now with ~30% discount on the Premium plan! diff --git a/src/pages/docs.tsx b/src/pages/docs.tsx index 4a4fb36557a..1b7741fe8fe 100644 --- a/src/pages/docs.tsx +++ b/src/pages/docs.tsx @@ -18,10 +18,7 @@ const StyledContentBody = styled.div` flex-wrap: wrap; gap: 15px; line-height: 1.8; - - ${Text} { - flex: 1; - } + overflow-x: auto; `; const StyledHighlight = styled.span<{ $link?: boolean; $alert?: boolean }>` @@ -51,7 +48,7 @@ const Docs = () => { - + <Title mb="sm" order={3} c="dark"> # Fetching from URL @@ -81,7 +78,7 @@ const Docs = () => { - + <Title mb="sm" order={3} c="dark"> # Embed Saved JSON @@ -102,10 +99,10 @@ const Docs = () => { - + <Title mb="sm" order={3} c="dark"> # Communicating with API -

◼︎ Post Message to Embed

+ ◼︎ Post Message to Embed Communicating with the embed is possible with{" "} @@ -141,7 +138,7 @@ const Docs = () => {
-

◼︎ On Page Load

+ ◼︎ On Page Load diff --git a/src/pages/index.tsx b/src/pages/index.tsx index b855d06bcb6..f627d3f35a2 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,7 +1,6 @@ import React from "react"; import Head from "next/head"; import Link from "next/link"; -import Script from "next/script"; import { Button, Group, Stack, Text } from "@mantine/core"; import styled from "styled-components"; import { FaChevronRight } from "react-icons/fa"; @@ -127,7 +126,6 @@ const HeroSection = () => ( fw="bold" rightSection={} size="md" - style={{ border: "2px solid orange" }} hiddenFrom="md" > GO TO EDITOR @@ -139,15 +137,12 @@ const HeroSection = () => ( ); export const HomePage = () => { - const [ads, setAds] = React.useState(false); - return ( JSON Crack | Visualize Instantly Into Graphs -