Skip to content

Commit

Permalink
Patch up the type errors so gh-pages can build (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
WalkQuackBack authored Apr 3, 2024
1 parent a4dbb83 commit 7ba5021
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
4 changes: 1 addition & 3 deletions src/components/FishCommandOutput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ function FishCommandOutput() {
}}
>
<Input value={output} readOnly></Input>
<CopyToClipboard
copyText={`!fish body:${fishData.bodyColor},hat:${fishData.hat}${fishData.hatColor},accessory:${fishData.accessory}${fishData.accessoryColor},eyewear:${fishData.eyewear}${fishData.eyewearColor},mouth:${fishData.mouth},fin:${fishData.fin}${fishData.finColor},effect:${fishData.effect}`}
/>
<CopyToClipboard copyText={output} />
</div>
</div>
</>
Expand Down
15 changes: 14 additions & 1 deletion src/components/FormComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
)) ||
Expand Down
6 changes: 6 additions & 0 deletions src/customizationData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const customizationData = {
soldier: ["primary"],
jameson: ["primary", "secondary"],
},
linkedTo: undefined,
},
hatColorPrimary: {
defaultValue: "#FF6600",
Expand Down Expand Up @@ -108,6 +109,7 @@ const customizationData = {
handlebar: ["primary"],
b2: ["primary"],
},
linkedTo: undefined,
},

accessoryColorPrimary: {
Expand Down Expand Up @@ -146,6 +148,7 @@ const customizationData = {
goggles: ["primary"],
eyelashes: ["nocolor"],
},
linkedTo: undefined,
},
eyewearColorPrimary: {
defaultValue: "#FF6600",
Expand Down Expand Up @@ -183,6 +186,7 @@ const customizationData = {
small: ["nocolor"],
morty: ["nocolor"],
},
linkedTo: undefined,
},

fin: {
Expand All @@ -195,6 +199,7 @@ const customizationData = {
jewel: ["primary"],
gills: ["primary"],
},
linkedTo: undefined,
},
finColorPrimary: {
defaultValue: "#8C1C13",
Expand Down Expand Up @@ -232,6 +237,7 @@ const customizationData = {
bubbles: ["nocolor"],
storm: ["nocolor"],
},
linkedTo: undefined,
},
};

Expand Down

0 comments on commit 7ba5021

Please sign in to comment.