Skip to content

Commit

Permalink
Move navigation item type definition to types dir
Browse files Browse the repository at this point in the history
  • Loading branch information
kpyszkowski committed Apr 22, 2024
1 parent 4ffdb22 commit 2a9b31a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
5 changes: 3 additions & 2 deletions dapp/src/components/Header/Navigation/Navigation.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from "react"
import { Box, BoxProps, HStack, List } from "@chakra-ui/react"
import NavigationItem, { NavigationItemProps } from "./NavigationItem"
import { NavigationItemType } from "#/types/navigation"
import NavigationItem from "./NavigationItem"

type NavigationProps = BoxProps & {
items: NavigationItemProps[]
items: NavigationItemType[]
}

function Navigation(props: NavigationProps) {
Expand Down
6 changes: 2 additions & 4 deletions dapp/src/components/Header/Navigation/NavigationItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ import {
useMultiStyleConfig,
} from "@chakra-ui/react"
import { motion } from "framer-motion"
import { NavigationItemType } from "#/types/navigation"
import { NavLink } from "../../shared/NavLink"

export type NavigationItemProps = ListItemProps & {
label: string
href: string
}
type NavigationItemProps = ListItemProps & NavigationItemType

function NavigationItem(props: NavigationItemProps) {
const { label, href, ...restProps } = props
Expand Down
1 change: 0 additions & 1 deletion dapp/src/components/Header/Navigation/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export { default as Navigation } from "./Navigation"
export { default as NavigationItem } from "./NavigationItem"
export type { NavigationItemProps as NavigationItemType } from "./NavigationItem"
3 changes: 2 additions & 1 deletion dapp/src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import React from "react"
import { AcreLogo } from "#/assets/icons"
import { routerPath } from "#/router/path"
import { Flex, HStack, Icon } from "@chakra-ui/react"
import { NavigationItemType } from "#/types/navigation"
import ConnectWallet from "./ConnectWallet"
import { Navigation, NavigationItemType } from "./Navigation"
import { Navigation } from "./Navigation"

// TODO: To be adjusted after project pivot/cleanup
const NAVIGATION_ITEMS: NavigationItemType[] = [
Expand Down
4 changes: 4 additions & 0 deletions dapp/src/types/navigation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export type NavigationItemType = {
label: string
href: string
}

0 comments on commit 2a9b31a

Please sign in to comment.