This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
generated from atls-academy/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: divide components in navigation section
- Loading branch information
Showing
11 changed files
with
246 additions
and
311 deletions.
There are no files selected for viewing
42 changes: 21 additions & 21 deletions
42
landing/fragments/landing-navigation/src/drawer/drawer-mobile.component.tsx
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
7 changes: 1 addition & 6 deletions
7
landing/fragments/landing-navigation/src/drawer/drawer.interfaces.ts
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,10 +1,5 @@ | ||
export interface DrawerIndexProps { | ||
active: boolean | ||
onClose: () => void | ||
sectionRefs: React.RefObject<HTMLDivElement>[] | ||
} | ||
|
||
export interface DrawerProps { | ||
active: boolean | ||
onClose: () => void | ||
children?: JSX.Element | ||
} |
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,2 +1,3 @@ | ||
export * from './navigation.component' | ||
export * from './navigation-mobile.component' | ||
export * from './navigation-index.component' |
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,2 +1,3 @@ | ||
export * from './item.component' | ||
export * from './item-drawer.component' | ||
export * from './item-navlinks.component' |
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
69 changes: 69 additions & 0 deletions
69
landing/fragments/landing-navigation/src/item/item-navlinks.component.tsx
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,69 @@ | ||
import React from 'react' | ||
import { FC } from 'react' | ||
|
||
import { Condition } from '@ui/condition' | ||
import { Divider } from '@ui/divider' | ||
import { Box } from '@ui/layout' | ||
import { Column } from '@ui/layout' | ||
import { Layout } from '@ui/layout' | ||
import { NextLink } from '@ui/link' | ||
import { Text } from '@ui/text' | ||
import { useHover } from '@ui/utils' | ||
|
||
import { ItemProps } from './item.interfaces' | ||
|
||
export const ItemNavLink: FC<ItemProps> = ({ name, path, active }: ItemProps) => { | ||
const { hover, hoverProps } = useHover() | ||
|
||
return ( | ||
<Box width={200} {...hoverProps} cursor='pointer'> | ||
<NextLink path={`/#${path}`} width='100%'> | ||
<Condition match={active!}> | ||
<Column alignItems='center'> | ||
<Box> | ||
<Text | ||
color={hover ? 'text.black' : 'text.ghost'} | ||
fontSize='compact' | ||
lineHeight='small' | ||
textTransform='uppercase' | ||
> | ||
{name} | ||
</Text> | ||
</Box> | ||
|
||
<Layout flexBasis={10} /> | ||
|
||
<Divider | ||
backgroundColor={hover ? 'background.black' : 'background.blackTransparent'} | ||
weight={1} | ||
width={200} | ||
/> | ||
</Column> | ||
</Condition> | ||
|
||
<Condition match={!active}> | ||
<Column alignItems='center'> | ||
<Box> | ||
<Text | ||
color={hover ? 'text.white' : 'text.gray'} | ||
fontSize='compact' | ||
lineHeight='small' | ||
textTransform='uppercase' | ||
> | ||
{name} | ||
</Text> | ||
</Box> | ||
|
||
<Layout flexBasis={10} /> | ||
|
||
<Divider | ||
backgroundColor={hover ? 'background.white' : 'background.gray'} | ||
weight={1} | ||
width={200} | ||
/> | ||
</Column> | ||
</Condition> | ||
</NextLink> | ||
</Box> | ||
) | ||
} |
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
Oops, something went wrong.