feat: add phase 1 runnable skeleton
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import type { ScreenId } from '../../app/navigation.js';
|
||||
import { navItems } from '../../app/navigation.js';
|
||||
|
||||
type BottomNavProps = {
|
||||
activeScreen: ScreenId;
|
||||
onNavigate: (screen: ScreenId) => void;
|
||||
};
|
||||
|
||||
export function BottomNav({ activeScreen, onNavigate }: BottomNavProps) {
|
||||
return (
|
||||
<nav className="bottom-nav" aria-label="Primary navigation">
|
||||
{navItems.map((item) => {
|
||||
const Icon = item.icon;
|
||||
const active = item.id === activeScreen;
|
||||
|
||||
return (
|
||||
<button
|
||||
aria-current={active ? 'page' : undefined}
|
||||
className="bottom-nav__item"
|
||||
key={item.id}
|
||||
onClick={() => onNavigate(item.id)}
|
||||
type="button"
|
||||
>
|
||||
<Icon aria-hidden="true" size={20} strokeWidth={2.4} />
|
||||
<span>{item.label}</span>
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user