diff --git a/src/App.tsx b/src/App.tsx index 457501e..431d654 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,6 +1,5 @@ import "./App.css"; -import HexColorApplet from "./components/HexColorApplet"; import CustomizationPanel from "./components/CustomizationPanel"; import FishPreview from "./components/FishPreview"; import FishCommandOutput from "./components/FishCommandOutput"; diff --git a/src/components/FishCommandOutput.tsx b/src/components/FishCommandOutput.tsx index 1bced2b..f42aaaa 100644 --- a/src/components/FishCommandOutput.tsx +++ b/src/components/FishCommandOutput.tsx @@ -72,9 +72,7 @@ function FishCommandOutput() { }} > - + diff --git a/src/components/FormComponent.tsx b/src/components/FormComponent.tsx index ff2039e..290453c 100644 --- a/src/components/FormComponent.tsx +++ b/src/components/FormComponent.tsx @@ -10,6 +10,7 @@ import fishDataType from "../fishDataType"; import customizationData from "../customizationData"; function FormComponent(props: { + // TODO: if anyone has a better way to define the types please let me know component: "color" | "dropdown"; label: string; identifier: string; @@ -22,14 +23,26 @@ function FormComponent(props: { switch (props.component) { case "color": // Leaving the type errors here I'm too tired to fix them 😓 - const selfData = customizationData[props.identifier]; + // TODO: actually fix the types and not just @ts-ignore them + const selfData: { + defaultValue: any; + label: string; + selectionOptions: string[]; + selectionOptionMetadata: {}; + linkedTo?: string; + colorType?: string; + // @ts-ignore TODO: fix types + } = customizationData[props.identifier]; + const selectionOptionMetadata = (selfData.linkedTo && + // @ts-ignore TODO: fix types customizationData[selfData.linkedTo].selectionOptionMetadata) || undefined; const colorPickerDisabled = (selfData.linkedTo && + // @ts-ignore TODO: fix types !selectionOptionMetadata[fishData[selfData.linkedTo]].find( (element: string) => element == selfData.colorType )) || diff --git a/src/customizationData.tsx b/src/customizationData.tsx index 1842fb9..a9287e6 100644 --- a/src/customizationData.tsx +++ b/src/customizationData.tsx @@ -62,6 +62,7 @@ const customizationData = { soldier: ["primary"], jameson: ["primary", "secondary"], }, + linkedTo: undefined, }, hatColorPrimary: { defaultValue: "#FF6600", @@ -108,6 +109,7 @@ const customizationData = { handlebar: ["primary"], b2: ["primary"], }, + linkedTo: undefined, }, accessoryColorPrimary: { @@ -146,6 +148,7 @@ const customizationData = { goggles: ["primary"], eyelashes: ["nocolor"], }, + linkedTo: undefined, }, eyewearColorPrimary: { defaultValue: "#FF6600", @@ -183,6 +186,7 @@ const customizationData = { small: ["nocolor"], morty: ["nocolor"], }, + linkedTo: undefined, }, fin: { @@ -195,6 +199,7 @@ const customizationData = { jewel: ["primary"], gills: ["primary"], }, + linkedTo: undefined, }, finColorPrimary: { defaultValue: "#8C1C13", @@ -232,6 +237,7 @@ const customizationData = { bubbles: ["nocolor"], storm: ["nocolor"], }, + linkedTo: undefined, }, };