mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-06-28 14:44:15 +00:00
feat: remove types
This commit is contained in:
parent
79040a126d
commit
e8353b601c
24 changed files with 37 additions and 266 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import { SwitchMiiInstructions } from "@/types";
|
||||
import { useState } from "react";
|
||||
import ColorPicker from "../color-picker";
|
||||
import TypeSelector from "../type-selector";
|
||||
import NumberInputs from "../number-inputs";
|
||||
|
||||
interface Props {
|
||||
|
|
@ -22,21 +21,10 @@ export default function OtherTab({ instructions }: Props) {
|
|||
const [tab, setTab] = useState(0);
|
||||
|
||||
// One type/color state per tab
|
||||
const [types, setTypes] = useState<number[]>([5, 0, 0, 0, 0, 0, 0]);
|
||||
const [colors, setColors] = useState<number[]>(Array(TABS.length).fill(0));
|
||||
|
||||
const currentTab = TABS[tab];
|
||||
|
||||
const setType = (value: number) => {
|
||||
setTypes((prev) => {
|
||||
const copy = [...prev];
|
||||
copy[tab] = value;
|
||||
return copy;
|
||||
});
|
||||
|
||||
instructions.current.eyes[currentTab.name].type = value;
|
||||
};
|
||||
|
||||
const setColor = (value: number) => {
|
||||
setColors((prev) => {
|
||||
const copy = [...prev];
|
||||
|
|
@ -69,10 +57,6 @@ export default function OtherTab({ instructions }: Props) {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex justify-center h-74 mt-auto">
|
||||
<TypeSelector hasNoneOption={tab === 0} length={currentTab.length} type={types[tab]} setType={setType} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="shrink-0 w-21 pb-3 flex flex-col items-center">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue