Skip to content

Commit

Permalink
refactor: refactor import paths and remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
michyaraque committed Feb 4, 2024
1 parent 268a276 commit b8c329b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
Stack,
Text,
useBreakpointValue,
useColorModeValue,
useDisclosure,
} from "@chakra-ui/react";

Expand Down Expand Up @@ -61,7 +60,7 @@ export default function Navbar() {
<Text
textAlign={useBreakpointValue({ base: "center", md: "left" })}
fontFamily={"heading"}
color={useColorModeValue("gray.800", "white")}
color="white"
>
<Link href="/">
<Image style={{ width: "128px" }} src="/images/fxd_logo.svg" />
Expand Down Expand Up @@ -112,9 +111,6 @@ export default function Navbar() {
}

const DesktopNav = () => {
const linkColor = useColorModeValue("gray.600", "gray.200");
const linkHoverColor = useColorModeValue("gray.800", "white");
const popoverContentBgColor = useColorModeValue("white", "gray.800");

return (
<Stack direction={"row"} spacing={4}>
Expand All @@ -128,10 +124,10 @@ const DesktopNav = () => {
href={navItem.href ?? "#"}
fontSize={"sm"}
fontWeight={500}
color={linkColor}
color="dust.600"
_hover={{
textDecoration: "none",
color: linkHoverColor,
color: "dust.800",
}}
>
{navItem.label}
Expand All @@ -142,7 +138,7 @@ const DesktopNav = () => {
<PopoverContent
border={0}
boxShadow={"xl"}
bg={popoverContentBgColor}
bg="neutrals.500"
p={4}
rounded={"xl"}
minW={"sm"}
Expand All @@ -168,7 +164,7 @@ const DesktopSubNav = ({ label, href = "", subLabel }: NavItem) => {
display={"block"}
p={2}
rounded={"md"}
_hover={{ bg: useColorModeValue("neutrals.100", "gray.900") }}
_hover={{ bg: "neutrals.900" }}
>
<Stack direction={"row"} align={"center"}>
<Box cursor="pointer">
Expand Down Expand Up @@ -202,7 +198,7 @@ const DesktopSubNav = ({ label, href = "", subLabel }: NavItem) => {
const MobileNav = () => {
return (
<Stack
bg={useColorModeValue("white", "gray.800")}
bg={"neutrals.500"}
p={4}
display={{ md: "none" }}
>
Expand Down Expand Up @@ -230,7 +226,7 @@ const MobileNavItem = ({ label, children, href }: NavItem) => {
>
<Text
fontWeight={600}
color={useColorModeValue("gray.600", "gray.200")}
color="neutrals.200"
>
{label}
</Text>
Expand All @@ -251,7 +247,7 @@ const MobileNavItem = ({ label, children, href }: NavItem) => {
pl={4}
borderLeft={1}
borderStyle={"solid"}
borderColor={useColorModeValue("gray.200", "gray.700")}
borderColor="neutrals.700"
align={"start"}
>
{children &&
Expand Down
2 changes: 1 addition & 1 deletion src/common/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { default as Layout } from "../layout/BaseLayout";
export { default as Navbar } from "./Common/Navbar";
export { default as Navbar } from "./Navbar";
export { default as DropdownMenu } from "./DropdownMenu";
export { default as SliderOpacity } from "./SliderOpacity";
2 changes: 1 addition & 1 deletion src/common/layout/BaseLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ReactNode } from "react";

import { Container } from "@chakra-ui/react";

import Navbar from "../components/Common/Navbar";
import Navbar from "../components/Navbar";

type BaseLayoutProps = { children: ReactNode };

Expand Down
1 change: 0 additions & 1 deletion src/common/setup/theme/chakra/components/Input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const Input: DeepPartial<ChakraTheme["components"]["Input"]> = {
md: {
field: {
borderRadius: '4px',
height: 12,
fontSize: 'md',
},
},
Expand Down
7 changes: 4 additions & 3 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { AppProps } from "next/app";
import Head from "next/head";

import { ChakraProvider } from "@chakra-ui/react";
import { ChakraProvider, ColorModeScript } from "@chakra-ui/react";
import "@fontsource/montserrat/latin.css";
import Layout from "common/layout/BaseLayout";
import "common/styles/theme/globals.css";
import fxdTheme from "common/styles/theme/FXDTheme";
import "common/setup/theme/globals.css";
import fxdTheme from "common/setup/theme/FXDTheme";

function App({ Component, pageProps }: AppProps) {
return (
Expand All @@ -21,6 +21,7 @@ function App({ Component, pageProps }: AppProps) {
crossOrigin=""
/>
</Head>
<ColorModeScript initialColorMode={fxdTheme.config.initialColorMode} />
<ChakraProvider resetCSS theme={fxdTheme}>
<Layout>
<Component {...pageProps} />
Expand Down

0 comments on commit b8c329b

Please sign in to comment.