mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-06-28 14:44:15 +00:00
fix: #10
Fixes/adds: - ability to edit instructions - center indicator on range inputs - birthdays
This commit is contained in:
parent
540480b665
commit
1e1c38ffc0
19 changed files with 344 additions and 153 deletions
|
|
@ -19,9 +19,13 @@ const TABS: { name: keyof SwitchMiiInstructions["eyes"]; length: number; colorsD
|
|||
|
||||
export default function EyesTab({ instructions }: Props) {
|
||||
const [tab, setTab] = useState(0);
|
||||
|
||||
// One type/color state per tab
|
||||
const [colors, setColors] = useState<number[]>(Array(TABS.length).fill(122));
|
||||
const [colors, setColors] = useState<number[]>(() =>
|
||||
TABS.map((t) => {
|
||||
const entry = instructions.current.eyes[t.name];
|
||||
const color = "color" in entry ? entry.color : null;
|
||||
return color ?? 122;
|
||||
}),
|
||||
);
|
||||
|
||||
const currentTab = TABS[tab];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue