-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from KNU-HAEDAL/Fix/layout-#146
레이아웃 전체적으로 수정 #146
- Loading branch information
Showing
11 changed files
with
192 additions
and
199 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import NavBar, { NAVBAR_HEIGHT } from '@/components/features/layout/nav-bar'; | ||
import { Box } from '@chakra-ui/react'; | ||
|
||
type NavBarLayoutTypes = { | ||
children: React.ReactNode; | ||
}; | ||
|
||
const NavBarLayout = ({ children }: NavBarLayoutTypes) => { | ||
return ( | ||
<Box> | ||
<Box minHeight={`calc(100vh - ${NAVBAR_HEIGHT})`}>{children}</Box> | ||
<NavBar /> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default NavBarLayout; |
This file was deleted.
Oops, something went wrong.
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,24 +1,63 @@ | ||
import NavBarButtons from './buttons.tsx'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
import { navBarData } from '@/constants/nav-bar'; | ||
import { Box } from '@chakra-ui/react'; | ||
import styled from '@emotion/styled'; | ||
|
||
type NavBarTypes = { | ||
children: React.ReactNode; | ||
}; | ||
export const NAVBAR_HEIGHT = '3.44rem'; | ||
|
||
const NavBar = () => { | ||
const navigate = useNavigate(); | ||
|
||
const handleNav = (page: string) => { | ||
navigate(page); | ||
}; | ||
|
||
const Index = ({ children }: NavBarTypes) => { | ||
return ( | ||
<> | ||
<Box | ||
display='flex' | ||
flexDirection='column' | ||
height='100%' | ||
paddingBottom='3.44' | ||
> | ||
<Box flex={1}>{children}</Box> | ||
<NavBarButtons /> | ||
</Box> | ||
</> | ||
<Wrapper> | ||
{navBarData.map((item) => ( | ||
<Tab key={item.title}> | ||
<Icon | ||
src={item.icon} | ||
// alt={item.title} | ||
onClick={() => handleNav(item.path)} | ||
/> | ||
</Tab> | ||
))} | ||
</Wrapper> | ||
); | ||
}; | ||
|
||
export default Index; | ||
export default NavBar; | ||
|
||
const Wrapper = styled(Box)` | ||
display: flex; | ||
flex-direction: row; | ||
width: 100%; | ||
height: ${NAVBAR_HEIGHT}; | ||
position: sticky; | ||
bottom: 0; | ||
left: 0; | ||
border-top: 0.5px solid #bdc5cd; | ||
background-color: #fafafa; | ||
`; | ||
|
||
const Tab = styled.div` | ||
width: 50%; | ||
height: 100%; | ||
display: inline-flex; | ||
justify-content: center; | ||
align-items: center; | ||
`; | ||
|
||
const Icon = styled.button<{ src: string }>` | ||
width: 2rem; | ||
height: 2rem; | ||
outline: none; | ||
background-image: url(${({ src }) => src}); | ||
background-size: cover; | ||
background-position: center; | ||
background-repeat: no-repeat; | ||
`; |
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
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
Oops, something went wrong.