Skip to content

Commit

Permalink
Merge pull request #446 from js43o/enhance-mogaco-page
Browse files Browse the repository at this point in the history
[Refactor] 헤더 및 모각코 리스트 페이지 접근성 개선
  • Loading branch information
js43o authored Dec 12, 2023
2 parents 86e5b49 + fda04a7 commit f26aac9
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 35 deletions.
37 changes: 20 additions & 17 deletions app/frontend/src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,31 @@ export function Header() {
const { onClickMenu } = useClickMenu();

return (
<div className={styles.container}>
<header className={styles.container}>
<div className={styles.header}>
<NavLink to="/" className={styles.title}>
<Logo className={styles.logo} />
<div className={styles.logoTitle}>morak</div>
</NavLink>
<ul className={styles.sideMenu}>
{SIDE_MENU.map((menu) => (
<li
role="menuitem"
key={menu.pathname}
onClick={() => onClickMenu(menu.pathname)}
onKeyDown={() => onClickMenu(menu.pathname)}
className={`${styles.sideMenuButton} ${
pathname === `/${menu.pathname}` ? styles.active : ''
}`}
>
{menu.value}
</li>
))}
</ul>
<nav>
<ul className={styles.sideMenu} role="menubar">
{SIDE_MENU.map((menu) => (
<li
key={menu.pathname}
onClick={() => onClickMenu(menu.pathname)}
onKeyDown={() => onClickMenu(menu.pathname)}
className={`${styles.sideMenuButton} ${
pathname === `/${menu.pathname}` ? styles.active : ''
}`}
role="menuitem"
aria-label={menu.pathname}
>
{menu.value}
</li>
))}
</ul>
</nav>
</div>
</div>
</header>
);
}
8 changes: 7 additions & 1 deletion app/frontend/src/components/Pagination/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ export function Pagination({

return (
<div className={`${styles.container} ${className}`}>
<button type="button" onClick={onClickPrev} disabled={isFirstPage}>
<button
type="button"
onClick={onClickPrev}
disabled={isFirstPage}
aria-label="prev-page"
>
{arrow}
</button>
{array.map((page) => (
Expand All @@ -52,6 +57,7 @@ export function Pagination({
className={styles.rotateArrow}
onClick={onClickNext}
disabled={isLastPage}
aria-label="next-page"
>
{arrow}
</button>
Expand Down
22 changes: 5 additions & 17 deletions app/frontend/src/pages/Mogaco/MogacoList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,37 +49,25 @@ export function MogacoList({ currentPage }: MogacoListProp) {
}

return (
<div className={styles.container}>
<main className={styles.container}>
{mogacoList && mogacoList.length > 0 ? (
mogacoList.map(
({
id,
groupId,
title,
contents,
date,
maxHumanCount,
address,
status,
group,
}) => (
({ id, title, contents, date, address, status, group }) => (
<MogacoItem
key={id}
id={id}
group={group}
title={title}
groupId={groupId}
contents={contents}
maxHumanCount={maxHumanCount}
address={address}
date={date}
address={address}
status={status}
group={group}
/>
),
)
) : (
<EmptyPage />
)}
</div>
</main>
);
}

0 comments on commit f26aac9

Please sign in to comment.