Skip to content

Commit 48eb9c2

Browse files
authored
Merge pull request #41 from pythonkr/feature/navigation-arrow
feat : navigation UX 개선
2 parents 8fdb4f4 + d267f09 commit 48eb9c2

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

apps/pyconkr/src/components/layout/Header/Mobile/MobileNavigation.tsx

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,16 @@ export const MobileNavigation: React.FC<MobileNavigationProps> = ({ isOpen, onCl
8787
.filter((s) => !s.hide)
8888
.map((menu) => (
8989
<MenuItem isMainPath={isMainPath} key={menu.id}>
90-
<MenuLink isMainPath={isMainPath} to={menu.route_code} onClick={handleClose}>
91-
{menu.name}
92-
</MenuLink>
93-
{!R.isEmpty(menu.children) && (
90+
{!R.isEmpty(menu.children) && Object.values(menu.children).some((child) => !child.hide) ? (
91+
<MenuButton isMainPath={isMainPath} onClick={() => navigateToDepth2(menu)}>
92+
{menu.name}
93+
</MenuButton>
94+
) : (
95+
<MenuLink isMainPath={isMainPath} to={menu.route_code} onClick={handleClose}>
96+
{menu.name}
97+
</MenuLink>
98+
)}
99+
{!R.isEmpty(menu.children) && Object.values(menu.children).some((child) => !child.hide) && (
94100
<MenuArrowButton isMainPath={isMainPath} onClick={() => navigateToDepth2(menu)}>
95101
<ArrowForward fontSize="small" />
96102
</MenuArrowButton>
@@ -123,7 +129,7 @@ export const MobileNavigation: React.FC<MobileNavigationProps> = ({ isOpen, onCl
123129
<Link to={`${navState.depth1!.route_code}/${menu.route_code}`} onClick={handleClose} style={{ textDecoration: "none" }}>
124130
<MenuChip isMainPath={isMainPath} label={menu.name} clickable />
125131
</Link>
126-
{!R.isEmpty(menu.children) && (
132+
{!R.isEmpty(menu.children) && Object.values(menu.children).some((child) => !child.hide) && (
127133
<MenuArrowButton isMainPath={isMainPath} onClick={() => navigateToDepth3(menu)}>
128134
<ArrowForward fontSize="small" />
129135
</MenuArrowButton>
@@ -250,6 +256,17 @@ const MenuLink = styled(Link)<{ isMainPath?: boolean }>(({ theme, isMainPath = t
250256
fontWeight: 600,
251257
}));
252258

259+
const MenuButton = styled(Button)<{ isMainPath?: boolean }>(({ theme, isMainPath = true }) => ({
260+
color: isMainPath ? theme.palette.mobileNavigation.main.text : theme.palette.mobileNavigation.sub.text,
261+
textTransform: "none",
262+
fontSize: "20px",
263+
fontWeight: 600,
264+
padding: 0,
265+
minWidth: "auto",
266+
minHeight: "auto",
267+
justifyContent: "flex-start",
268+
}));
269+
253270
const MenuArrowButton = styled(IconButton)<{ isMainPath?: boolean }>(({ theme, isMainPath = true }) => ({
254271
color: isMainPath ? theme.palette.mobileNavigation.main.text : theme.palette.mobileNavigation.sub.text,
255272
padding: 8,

0 commit comments

Comments
 (0)