From e755f1ab168ede5563e8515cd9cdf7f778bab793 Mon Sep 17 00:00:00 2001 From: Jinwoo Lee Date: Thu, 8 Feb 2024 04:03:07 +0900 Subject: [PATCH 1/8] =?UTF-8?q?feat:=20=EC=B8=A1=EB=A9=B4=20=EB=94=94?= =?UTF-8?q?=EC=9E=90=EC=9D=B8=20=EC=83=89=EC=83=81=20=EC=A0=84=EC=97=AD?= =?UTF-8?q?=EC=83=81=ED=83=9C=20=EA=B5=AC=ED=98=84=20#23?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/context/color.ts | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/context/color.ts diff --git a/src/context/color.ts b/src/context/color.ts new file mode 100644 index 0000000..ea1889e --- /dev/null +++ b/src/context/color.ts @@ -0,0 +1,6 @@ +import { atom } from 'recoil'; + +export const selectedColorIdState = atom({ + key: 'selectedColorIdState', + default: 0, +}); From 7929016d6b74c5e84c28a586f3ee2a7f846809ad Mon Sep 17 00:00:00 2001 From: Jinwoo Lee Date: Thu, 8 Feb 2024 04:03:36 +0900 Subject: [PATCH 2/8] =?UTF-8?q?feat:=20=EC=B8=A1=EB=A9=B4=20=EB=94=94?= =?UTF-8?q?=EC=9E=90=EC=9D=B8=20=EA=B8=80=EA=BC=B4=20=EC=A0=84=EC=97=AD?= =?UTF-8?q?=EC=83=81=ED=83=9C=20=EA=B5=AC=ED=98=84=20#23?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/context/font.ts | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/context/font.ts diff --git a/src/context/font.ts b/src/context/font.ts new file mode 100644 index 0000000..a3268a2 --- /dev/null +++ b/src/context/font.ts @@ -0,0 +1,6 @@ +import { atom } from 'recoil'; + +export const selectedFontIdState = atom({ + key: 'selectedFontIdState', + default: 0, +}); From 32df3ec8597997f49fa2ca0aecc3e3c81cbcfa69 Mon Sep 17 00:00:00 2001 From: Jinwoo Lee Date: Thu, 8 Feb 2024 04:31:54 +0900 Subject: [PATCH 3/8] =?UTF-8?q?refactor:=20custom=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=ED=9B=85=20=EB=B6=84=EB=A6=AC=20#23?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useCustomData.ts | 41 ++++++++++++++++++++++++++++++++++++++ tsconfig.json | 3 ++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 src/hooks/useCustomData.ts diff --git a/src/hooks/useCustomData.ts b/src/hooks/useCustomData.ts new file mode 100644 index 0000000..e595613 --- /dev/null +++ b/src/hooks/useCustomData.ts @@ -0,0 +1,41 @@ +import { Accessory } from '@api/accessory'; +import { AccessoryData } from '@api/accessory.types'; +import { Color } from '@api/color'; +import { ColorData } from '@api/color.types'; +import { Font } from '@api/font'; +import { FontData } from '@api/font.types'; +import { Pattern } from '@api/pattern'; +import { PatternData } from '@api/pattern.types'; +import { Wheel } from '@api/wheel'; +import { WheelData } from '@api/wheel.types'; +import { useEffect, useState } from 'react'; + +function useCustomData() { + const [pattern, setPattern] = useState([]); + const [wheel, setWheel] = useState([]); + const [font, setFont] = useState([]); + const [color, setColor] = useState([]); + const [accessory, setAccessory] = useState([]); + + useEffect(() => { + const getData = async () => { + const [patterns, wheels, fonts, colors, accessories] = await Promise.all([ + Pattern.list(), + Wheel.list(), + Font.list(), + Color.list(), + Accessory.list(), + ]); + setPattern(patterns); + setWheel(wheels); + setFont(fonts); + setColor(colors); + setAccessory(accessories); + }; + getData(); + }, []); + + return { pattern, wheel, font, color, accessory }; +} + +export default useCustomData; diff --git a/tsconfig.json b/tsconfig.json index 0f41ca5..99efc36 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,7 +25,8 @@ "@components/*": ["./components/*"], "@pages/*": ["./pages/*"], "@api/*": ["./api/*"], - "@context/*": ["./context/*"] + "@context/*": ["./context/*"], + "@hooks/*": ["./hooks/*"] } }, "include": [ From 1e40d7921ee0381292c812e5f905a3ee0c709651 Mon Sep 17 00:00:00 2001 From: Jinwoo Lee Date: Thu, 8 Feb 2024 05:14:43 +0900 Subject: [PATCH 4/8] =?UTF-8?q?refactor:=20=ED=8F=B0=ED=8A=B8=20=EB=B0=8F?= =?UTF-8?q?=20=EC=83=89=EC=83=81=20=ED=95=AD=EB=AA=A9=EC=B6=94=EA=B0=80?= =?UTF-8?q?=EC=97=90=20=EB=94=B0=EB=A5=B8=20=ED=95=AD=EB=AA=A9=20=EC=84=A0?= =?UTF-8?q?=ED=83=9D=20=EC=83=81=EC=9E=90=20=EB=A6=AC=ED=8C=A9=ED=86=A0?= =?UTF-8?q?=EB=A7=81=20#23?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/production/button-group/index.tsx | 2 +- .../option-selector/index.style.tsx | 26 +++++- .../production/option-selector/index.tsx | 81 ++++++++++++------- .../option-selector/item/index.style.tsx | 42 +++++++++- .../production/option-selector/item/index.tsx | 22 +++-- 5 files changed, 132 insertions(+), 41 deletions(-) diff --git a/src/pages/production/button-group/index.tsx b/src/pages/production/button-group/index.tsx index c0a0526..78eac67 100644 --- a/src/pages/production/button-group/index.tsx +++ b/src/pages/production/button-group/index.tsx @@ -19,7 +19,7 @@ function ButtonGroup(props: ButtonGroupProps) {