+
-
-
-
+
-
+ }
+
+ /* TURNED OFF */
+ async function init() {
+ // await loadModifiers()
+ // await getDiskPath()
+ // await getAppConfig()
+ // setInterval(healthCheck, HEALTH_PING_INTERVAL * 1000)
+ // healthCheck()
+ // playSound()
+ }
+
+ init();
+
+
diff --git a/ui/frontend/build_src/package-lock.json b/ui/frontend/build_src/package-lock.json
index 812e9253..6cb2710c 100644
--- a/ui/frontend/build_src/package-lock.json
+++ b/ui/frontend/build_src/package-lock.json
@@ -21,6 +21,7 @@
"@types/react-dom": "^18.0.6",
"@types/uuid": "^8.3.4",
"@vitejs/plugin-react": "^2.0.1",
+ "prettier": "^2.7.1",
"typescript": "^4.6.4",
"vite": "^3.0.7"
}
@@ -1326,6 +1327,21 @@
"node": "^10 || ^12 || >=14"
}
},
+ "node_modules/prettier": {
+ "version": "2.7.1",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz",
+ "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==",
+ "dev": true,
+ "bin": {
+ "prettier": "bin-prettier.js"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ },
+ "funding": {
+ "url": "https://github.com/prettier/prettier?sponsor=1"
+ }
+ },
"node_modules/react": {
"version": "18.2.0",
"resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz",
@@ -2418,6 +2434,12 @@
"source-map-js": "^1.0.2"
}
},
+ "prettier": {
+ "version": "2.7.1",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz",
+ "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==",
+ "dev": true
+ },
"react": {
"version": "18.2.0",
"resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz",
diff --git a/ui/frontend/build_src/package.json b/ui/frontend/build_src/package.json
index dcf74148..bfaf173b 100644
--- a/ui/frontend/build_src/package.json
+++ b/ui/frontend/build_src/package.json
@@ -4,6 +4,7 @@
"version": "0.0.0",
"type": "module",
"scripts": {
+ "pretty": "prettier --write .",
"dev": "vite",
"build": "tsc && vite build --emptyOutDir",
"preview": "vite preview"
@@ -22,6 +23,7 @@
"@types/react-dom": "^18.0.6",
"@types/uuid": "^8.3.4",
"@vitejs/plugin-react": "^2.0.1",
+ "prettier": "^2.7.1",
"typescript": "^4.6.4",
"vite": "^3.0.7"
}
diff --git a/ui/frontend/build_src/public/modifiers.json b/ui/frontend/build_src/public/modifiers.json
index d1191cb5..5d01cdba 100644
--- a/ui/frontend/build_src/public/modifiers.json
+++ b/ui/frontend/build_src/public/modifiers.json
@@ -62,14 +62,7 @@
],
[
"Pen",
- [
- "Chalk",
- "Colored Pencil",
- "Graphite",
- "Ink",
- "Oil Paint",
- "Pastel Art"
- ]
+ ["Chalk", "Colored Pencil", "Graphite", "Ink", "Oil Paint", "Pastel Art"]
],
[
"Carving and Etching",
diff --git a/ui/frontend/build_src/src/App.css b/ui/frontend/build_src/src/App.css
index 95b693d5..4377ca6e 100644
--- a/ui/frontend/build_src/src/App.css
+++ b/ui/frontend/build_src/src/App.css
@@ -7,9 +7,10 @@
background-color: rgb(32, 33, 36);
grid-template-columns: 360px 1fr;
grid-template-rows: 100px 1fr 300px;
- grid-template-areas: "header header header"
- "create display display"
- "footer footer footer";
+ grid-template-areas:
+ "header header header"
+ "create display display"
+ "footer footer footer";
}
/* Very basic mobile stacked UI*/
@@ -17,10 +18,11 @@
.App {
grid-template-columns: 1fr;
grid-template-rows: 100px 1fr 1fr 300px;
- grid-template-areas: "header"
- "create"
- "display"
- "footer";
+ grid-template-areas:
+ "header"
+ "create"
+ "display"
+ "footer";
}
}
@@ -38,23 +40,23 @@
.footer-layout {
grid-area: footer;
-
}
/* Copypasta from Bootstrap, makes content visually hidden but still accessible for screenreaders */
-.visually-hidden, .visually-hidden-focusable:not(:focus):not(:focus-within) {
- position: absolute !important;
- width: 1px !important;
- height: 1px !important;
- padding: 0 !important;
- margin: -1px !important;
- overflow: hidden !important;
- clip: rect(0, 0, 0, 0) !important;
- white-space: nowrap !important;
- border: 0 !important;
+.visually-hidden,
+.visually-hidden-focusable:not(:focus):not(:focus-within) {
+ position: absolute !important;
+ width: 1px !important;
+ height: 1px !important;
+ padding: 0 !important;
+ margin: -1px !important;
+ overflow: hidden !important;
+ clip: rect(0, 0, 0, 0) !important;
+ white-space: nowrap !important;
+ border: 0 !important;
}
/* TODO proper utility classes */
.mb-4 {
margin-bottom: 1rem;
-}
\ No newline at end of file
+}
diff --git a/ui/frontend/build_src/src/App.tsx b/ui/frontend/build_src/src/App.tsx
index f9642370..7f9def7a 100644
--- a/ui/frontend/build_src/src/App.tsx
+++ b/ui/frontend/build_src/src/App.tsx
@@ -1,30 +1,26 @@
-import React, {useEffect, useState} from 'react'
-import './App.css'
+import React, { useEffect, useState } from "react";
+import "./App.css";
import { useQuery } from "@tanstack/react-query";
-import { getSaveDirectory } from './api'
+import { getSaveDirectory } from "./api";
import { useImageCreate } from "./store/imageCreateStore";
// Todo - import components here
-import HeaderDisplay from './components/headerDisplay';
-import CreationPanel from './components/creationPanel';
-import DisplayPanel from './components/displayPanel';
-import FooterDisplay from './components/footerDisplay';
+import HeaderDisplay from "./components/headerDisplay";
+import CreationPanel from "./components/creationPanel";
+import DisplayPanel from "./components/displayPanel";
+import FooterDisplay from "./components/footerDisplay";
function App() {
-
// Get the original save directory
const setRequestOption = useImageCreate((state) => state.setRequestOptions);
- const { status, data } = useQuery(
- ['SaveDir'], getSaveDirectory,
- );
+ const { status, data } = useQuery(["SaveDir"], getSaveDirectory);
useEffect(() => {
- if(status === 'success') {
+ if (status === "success") {
setRequestOption("save_to_disk_path", data);
}
}, [setRequestOption, status, data]);
-
return (
@@ -40,7 +36,7 @@ function App() {
- )
+ );
}
-export default App
+export default App;
diff --git a/ui/frontend/build_src/src/api/index.ts b/ui/frontend/build_src/src/api/index.ts
index ce3eb655..22a31161 100644
--- a/ui/frontend/build_src/src/api/index.ts
+++ b/ui/frontend/build_src/src/api/index.ts
@@ -2,21 +2,19 @@
* basic server health
*/
-import type {ImageRequest} from '../store/imageCreateStore';
+import type { ImageRequest } from "../store/imageCreateStore";
// when we are on dev we want to specifiy 9000 as the port for the backend
// when we are on prod we want be realtive to the current url
-const API_URL = import.meta.env.DEV ? 'http://localhost:9000' : '';
-
+const API_URL = import.meta.env.DEV ? "http://localhost:9000" : "";
export const HEALTH_PING_INTERVAL = 5000; // 5 seconds
export const healthPing = async () => {
-
const pingUrl = `${API_URL}/ping`;
- let response = await fetch(pingUrl)
+ let response = await fetch(pingUrl);
const data = await response.json();
return data;
-}
+};
/**
* the local list of modifications
@@ -25,11 +23,11 @@ export const loadModifications = async () => {
const response = await fetch(`${API_URL}/modifiers.json`);
const data = await response.json();
return data;
-}
+};
export const getSaveDirectory = async () => {
const response = await fetch(`${API_URL}/output_dir`);
- const data = await response.json();
+ const data = await response.json();
return data[0];
};
@@ -37,21 +35,18 @@ export const getSaveDirectory = async () => {
* post a new request for an image
*/
-export const MakeImageKey = 'MakeImage';
+export const MakeImageKey = "MakeImage";
export const doMakeImage = async (reqBody: ImageRequest) => {
-
- const {seed, num_outputs} = reqBody;
+ const { seed, num_outputs } = reqBody;
const res = await fetch(`${API_URL}/image`, {
- method: 'POST',
+ method: "POST",
headers: {
- 'Content-Type': 'application/json'
+ "Content-Type": "application/json",
},
- body: JSON.stringify(reqBody)
+ body: JSON.stringify(reqBody),
});
const data = await res.json();
return data;
-}
-
-
+};
diff --git a/ui/frontend/build_src/src/components/creationPanel/advancedSettings/advancedSettings.css b/ui/frontend/build_src/src/components/creationPanel/advancedSettings/advancedSettings.css
index 054ba201..90fbac25 100644
--- a/ui/frontend/build_src/src/components/creationPanel/advancedSettings/advancedSettings.css
+++ b/ui/frontend/build_src/src/components/creationPanel/advancedSettings/advancedSettings.css
@@ -1,3 +1,3 @@
input[size="4"] {
- width: 4.5rem;
-}
\ No newline at end of file
+ width: 4.5rem;
+}
diff --git a/ui/frontend/build_src/src/components/creationPanel/advancedSettings/index.tsx b/ui/frontend/build_src/src/components/creationPanel/advancedSettings/index.tsx
index cf4e11e7..d3e2d695 100644
--- a/ui/frontend/build_src/src/components/creationPanel/advancedSettings/index.tsx
+++ b/ui/frontend/build_src/src/components/creationPanel/advancedSettings/index.tsx
@@ -1,4 +1,4 @@
-import React, {useEffect} from "react";
+import React, { useEffect } from "react";
import { useImageCreate } from "../../../store/imageCreateStore";
import "./advancedSettings.css";
@@ -22,313 +22,319 @@ const IMAGE_DIMENSIONS = [
];
function SettingsList() {
-
const parallelCount = useImageCreate((state) => state.parallelCount);
const setParallelCount = useImageCreate((state) => state.setParallelCount);
const setRequestOption = useImageCreate((state) => state.setRequestOptions);
-
- const toggleUseFaceCorrection = useImageCreate((state) => state.toggleUseFaceCorrection);
- const isUsingFaceCorrection = useImageCreate((state) => state.isUsingFaceCorrection());
-
- const toggleUseUpscaling = useImageCreate((state) => state.toggleUseUpscaling);
- const isUsingUpscaling = useImageCreate((state) => state.isUsingUpscaling());
-
+ const toggleUseFaceCorrection = useImageCreate(
+ (state) => state.toggleUseFaceCorrection
+ );
+ const isUsingFaceCorrection = useImageCreate((state) =>
+ state.isUsingFaceCorrection()
+ );
- const toggleUseRandomSeed = useImageCreate((state) => state.toggleUseRandomSeed);
+ const toggleUseUpscaling = useImageCreate(
+ (state) => state.toggleUseUpscaling
+ );
+ const isUsingUpscaling = useImageCreate((state) => state.isUsingUpscaling());
+
+ const toggleUseRandomSeed = useImageCreate(
+ (state) => state.toggleUseRandomSeed
+ );
const isRandomSeed = useImageCreate((state) => state.isRandomSeed());
-
+
const toggleUseAutoSave = useImageCreate((state) => state.toggleUseAutoSave);
const isUseAutoSave = useImageCreate((state) => state.isUseAutoSave());
- const toggleSoundEnabled = useImageCreate((state) => state.toggleSoundEnabled);
+ const toggleSoundEnabled = useImageCreate(
+ (state) => state.toggleSoundEnabled
+ );
const isSoundEnabled = useImageCreate((state) => state.isSoundEnabled());
- const use_upscale = useImageCreate((state) => state.getValueForRequestKey(('use_upscale')));
- const show_only_filtered_image = useImageCreate((state) => state.getValueForRequestKey(('show_only_filtered_image')));
- const seed = useImageCreate((state) => state.getValueForRequestKey(('seed')));
- const width = useImageCreate((state) => state.getValueForRequestKey(('width')));
- const num_outputs = useImageCreate((state) => state.getValueForRequestKey(('num_outputs')));
- const height = useImageCreate((state) => state.getValueForRequestKey(('height')));
- const steps = useImageCreate((state) => state.getValueForRequestKey(('num_inference_steps')));
- const guidance_scale = useImageCreate((state) => state.getValueForRequestKey(('guidance_scale')));
- const prompt_strength = useImageCreate((state) => state.getValueForRequestKey(('prompt_strength')));
- const save_to_disk_path = useImageCreate((state) => state.getValueForRequestKey(('save_to_disk_path')));
- const turbo = useImageCreate((state) => state.getValueForRequestKey(('turbo')));
- const use_cpu = useImageCreate((state) => state.getValueForRequestKey(('use_cpu')));
- const use_full_precision = useImageCreate((state) => state.getValueForRequestKey(('use_full_precision')));
+ const use_upscale = useImageCreate((state) =>
+ state.getValueForRequestKey("use_upscale")
+ );
+ const show_only_filtered_image = useImageCreate((state) =>
+ state.getValueForRequestKey("show_only_filtered_image")
+ );
+ const seed = useImageCreate((state) => state.getValueForRequestKey("seed"));
+ const width = useImageCreate((state) => state.getValueForRequestKey("width"));
+ const num_outputs = useImageCreate((state) =>
+ state.getValueForRequestKey("num_outputs")
+ );
+ const height = useImageCreate((state) =>
+ state.getValueForRequestKey("height")
+ );
+ const steps = useImageCreate((state) =>
+ state.getValueForRequestKey("num_inference_steps")
+ );
+ const guidance_scale = useImageCreate((state) =>
+ state.getValueForRequestKey("guidance_scale")
+ );
+ const prompt_strength = useImageCreate((state) =>
+ state.getValueForRequestKey("prompt_strength")
+ );
+ const save_to_disk_path = useImageCreate((state) =>
+ state.getValueForRequestKey("save_to_disk_path")
+ );
+ const turbo = useImageCreate((state) => state.getValueForRequestKey("turbo"));
+ const use_cpu = useImageCreate((state) =>
+ state.getValueForRequestKey("use_cpu")
+ );
+ const use_full_precision = useImageCreate((state) =>
+ state.getValueForRequestKey("use_full_precision")
+ );
return (
-
- {/*IMAGE CORRECTION */}
-
-
-
- toggleUseFaceCorrection()
- }
- />
- Fix incorrect faces and eyes (uses GFPGAN)
-
-
-
-
-
- toggleUseUpscaling()
- }
- />
- Upscale the image to 4x resolution using
-
- RealESRGAN_x4plus
- RealESRGAN_x4plus_anime_6B
-
-
-
-
-
-
- setRequestOption("show_only_filtered_image", e.target.checked)
- }
- />
- Show only filtered image
-
-
-
- {/* SEED */}
-
-
- Seed:
-
- setRequestOption("seed", e.target.value)
- }
- disabled={isRandomSeed}
- placeholder="random"
- />
-
-
-
- toggleUseRandomSeed()
- }
- />{" "}
- Random Image
-
-
- {/* COUNT */}
-
-
- Number of images to make:{" "}
-
- setRequestOption("num_outputs", parseInt(e.target.value, 10))
- }
- size={4}
- />
-
-
- Generate in parallel:
-
- setParallelCount(parseInt(e.target.value, 10))
- }
- size={4}
- />
+ {/*IMAGE CORRECTION */}
+
+
+ toggleUseFaceCorrection()}
+ />
+ Fix incorrect faces and eyes (uses GFPGAN)
-
- {/* DIMENTIONS */}
-
-
- Width:
-
- setRequestOption("width", e.target.value)
- }
- >
- {IMAGE_DIMENSIONS.map((dimension) => (
-
- {dimension.label}
+
+
+
+ toggleUseUpscaling()}
+ />
+ Upscale the image to 4x resolution using
+
+ RealESRGAN_x4plus
+
+ RealESRGAN_x4plus_anime_6B
- ))}
-
-
-
-
-
- Height:
-
- setRequestOption("height", e.target.value)
- }
- >
- {IMAGE_DIMENSIONS.map((dimension) => (
-
- {dimension.label}
-
- ))}
-
-
-
- {/* STEPS */}
-
-
- Number of inference steps:{" "}
- {
- setRequestOption("num_inference_steps", e.target.value)
- }}
- size={4}
- />
-
-
- {/* GUIDANCE SCALE */}
-
-
- Guidance Scale:
-
- setRequestOption("guidance_scale", e.target.value)
- }
- type="range"
- min="0"
- max="20"
- step=".1"
- />
-
- {guidance_scale}
-
- {/* PROMPT STRENGTH */}
-
-
- Prompt Strength:{" "}
-
- // setImageOptions({ promptStrength: Number(e.target.value) })
- setRequestOption("prompt_strength", e.target.value)
- }
- type="range"
- min="0"
- max="1"
- step=".05"
- />
-
- {prompt_strength}
-
- {/* AUTO SAVE */}
-
-
-
- toggleUseAutoSave()
- }
- type="checkbox"
- />
- Automatically save to{" "}
-
-
-
- setRequestOption("save_to_disk_path", e.target.value)
- }
- size={40}
- disabled={!isUseAutoSave}
- />
-
- Path on disk where images will be saved
-
-
-
- {/* SOUND */}
-
-
-
- toggleSoundEnabled()
- }
- type="checkbox"
- />
- Play sound on task completion
-
-
- {/* GENERATE */}
-
-
-
- setRequestOption("turbo", e.target.checked)
- }
- type="checkbox"
- />
- Turbo mode (generates images faster, but uses an additional 1 GB
- of GPU memory)
-
-
-
-
-
- setRequestOption("use_cpu", e.target.checked)
- }
- />
- Use CPU instead of GPU (warning: this will be *very* slow)
-
-
-
-
-
- setRequestOption("use_full_precision", e.target.checked)
- }
- type="checkbox"
- />
- Use full precision (for GPU-only. warning: this will consume more
- VRAM)
-
-
-
-
- )
+
+
+
+
+
+
+ setRequestOption("show_only_filtered_image", e.target.checked)
+ }
+ />
+ Show only filtered image
+
+
+ {/* SEED */}
+
+
+ Seed:
+ setRequestOption("seed", e.target.value)}
+ disabled={isRandomSeed}
+ placeholder="random"
+ />
+
+
+ toggleUseRandomSeed()}
+ />{" "}
+ Random Image
+
+
+ {/* COUNT */}
+
+
+ Number of images to make:{" "}
+
+ setRequestOption("num_outputs", parseInt(e.target.value, 10))
+ }
+ size={4}
+ />
+
+
+ Generate in parallel:
+ setParallelCount(parseInt(e.target.value, 10))}
+ size={4}
+ />
+
+
+ {/* DIMENTIONS */}
+
+
+ Width:
+ setRequestOption("width", e.target.value)}
+ >
+ {IMAGE_DIMENSIONS.map((dimension) => (
+
+ {dimension.label}
+
+ ))}
+
+
+
+
+
+ Height:
+ setRequestOption("height", e.target.value)}
+ >
+ {IMAGE_DIMENSIONS.map((dimension) => (
+
+ {dimension.label}
+
+ ))}
+
+
+
+ {/* STEPS */}
+
+
+ Number of inference steps:{" "}
+ {
+ setRequestOption("num_inference_steps", e.target.value);
+ }}
+ size={4}
+ />
+
+
+ {/* GUIDANCE SCALE */}
+
+
+ Guidance Scale:
+ setRequestOption("guidance_scale", e.target.value)}
+ type="range"
+ min="0"
+ max="20"
+ step=".1"
+ />
+
+ {guidance_scale}
+
+ {/* PROMPT STRENGTH */}
+
+
+ Prompt Strength:{" "}
+
+ // setImageOptions({ promptStrength: Number(e.target.value) })
+ setRequestOption("prompt_strength", e.target.value)
+ }
+ type="range"
+ min="0"
+ max="1"
+ step=".05"
+ />
+
+ {prompt_strength}
+
+ {/* AUTO SAVE */}
+
+
+ toggleUseAutoSave()}
+ type="checkbox"
+ />
+ Automatically save to{" "}
+
+
+
+ setRequestOption("save_to_disk_path", e.target.value)
+ }
+ size={40}
+ disabled={!isUseAutoSave}
+ />
+
+ Path on disk where images will be saved
+
+
+
+ {/* SOUND */}
+
+
+ toggleSoundEnabled()}
+ type="checkbox"
+ />
+ Play sound on task completion
+
+
+ {/* GENERATE */}
+
+
+ setRequestOption("turbo", e.target.checked)}
+ type="checkbox"
+ />
+ Turbo mode (generates images faster, but uses an additional 1 GB of
+ GPU memory)
+
+
+
+
+ setRequestOption("use_cpu", e.target.checked)}
+ />
+ Use CPU instead of GPU (warning: this will be *very* slow)
+
+
+
+
+
+ setRequestOption("use_full_precision", e.target.checked)
+ }
+ type="checkbox"
+ />
+ Use full precision (for GPU-only. warning: this will consume more
+ VRAM)
+
+
+
+ );
}
// {/* */}
export default function AdvancedSettings() {
-
const advancedSettingsIsOpen = useImageCreate(
(state) => state.uiOptions.advancedSettingsIsOpen
);
@@ -346,7 +352,7 @@ export default function AdvancedSettings() {
>
Advanced Settings
- {advancedSettingsIsOpen &&
}
+ {advancedSettingsIsOpen &&
}
);
}
diff --git a/ui/frontend/build_src/src/components/creationPanel/creationPanel.css b/ui/frontend/build_src/src/components/creationPanel/creationPanel.css
index fc6b861a..69347440 100644
--- a/ui/frontend/build_src/src/components/creationPanel/creationPanel.css
+++ b/ui/frontend/build_src/src/components/creationPanel/creationPanel.css
@@ -1,48 +1,48 @@
.panel-box-toggle-btn {
- display: block;
- width: 100%;
- text-align: left;
- background-color: transparent;
- color: #fff;
- border: 0 none;
- cursor: pointer;
+ display: block;
+ width: 100%;
+ text-align: left;
+ background-color: transparent;
+ color: #fff;
+ border: 0 none;
+ cursor: pointer;
}
.selected-tags {
- margin: 10px 0;
+ margin: 10px 0;
}
.selected-tags ul {
- margin: 0;
- padding: 0;
- display: flex;
- flex-wrap: wrap;
+ margin: 0;
+ padding: 0;
+ display: flex;
+ flex-wrap: wrap;
}
li {
- list-style: none;
+ list-style: none;
}
-.modifier-list{
- display: flex;
- flex-wrap: wrap;
- margin: 0;
- padding: 0;
+.modifier-list {
+ display: flex;
+ flex-wrap: wrap;
+ margin: 0;
+ padding: 0;
}
.modifierTag {
- display: inline-block;
- padding: 6px;
- background-color: rgb(38, 77, 141);
- color: #fff;
- border-radius: 5px;
- margin: 5px;
+ display: inline-block;
+ padding: 6px;
+ background-color: rgb(38, 77, 141);
+ color: #fff;
+ border-radius: 5px;
+ margin: 5px;
}
.modifierTag.selected {
- background-color: rgb(131, 11, 121);
+ background-color: rgb(131, 11, 121);
}
.modifierTag p {
- margin: 0;
-}
\ No newline at end of file
+ margin: 0;
+}
diff --git a/ui/frontend/build_src/src/components/creationPanel/imageModifiers/index.tsx b/ui/frontend/build_src/src/components/creationPanel/imageModifiers/index.tsx
index ff13e869..39a8b0f2 100644
--- a/ui/frontend/build_src/src/components/creationPanel/imageModifiers/index.tsx
+++ b/ui/frontend/build_src/src/components/creationPanel/imageModifiers/index.tsx
@@ -1,4 +1,4 @@
-import React, {useEffect, useState} from "react";
+import React, { useEffect, useState } from "react";
import { useQuery } from "@tanstack/react-query";
import { loadModifications } from "../../../api";
@@ -7,23 +7,22 @@ import { useImageCreate } from "../../../store/imageCreateStore";
import ModifierTag from "../modierTag";
-
type ModifierListProps = {
tags: string[];
-}
+};
-function ModifierList({tags}: ModifierListProps) {
+function ModifierList({ tags }: ModifierListProps) {
// const setImageOptions = useImageCreate((state) => state.setImageOptions);
// const imageOptions = useImageCreate((state) => state.imageOptions);
- return(
+ return (
- )
+ );
}
type ModifierGroupingProps = {
@@ -31,13 +30,11 @@ type ModifierGroupingProps = {
tags: string[];
};
-function ModifierGrouping({title, tags}: ModifierGroupingProps) {
-
+function ModifierGrouping({ title, tags }: ModifierGroupingProps) {
// doing this localy for now, but could move to a store
// and persist if we wanted to
const [isExpanded, setIsExpanded] = useState(false);
-
const _toggleExpand = () => {
setIsExpanded(!isExpanded);
};
@@ -53,7 +50,7 @@ function ModifierGrouping({title, tags}: ModifierGroupingProps) {
}
export default function ImageModifers() {
- const {status, data} = useQuery(["modifications"], loadModifications);
+ const { status, data } = useQuery(["modifications"], loadModifications);
const imageModifierIsOpen = useImageCreate(
(state) => state.uiOptions.imageModifierIsOpen
@@ -62,7 +59,6 @@ export default function ImageModifers() {
(state) => state.toggleImageModifiersIsOpen
);
-
const handleClick = () => {
toggleImageModifiersIsOpen();
};
@@ -79,11 +75,13 @@ export default function ImageModifers() {
{/* @ts-ignore */}
- {imageModifierIsOpen && data.map((item, index) => {
- return (
-