From e6a4364d3abf1fbc7bc216a0f737178359b8a8f0 Mon Sep 17 00:00:00 2001 From: ktmihs Date: Fri, 25 Nov 2022 17:26:08 +0900 Subject: [PATCH 1/4] =?UTF-8?q?[chore]=20#85=20recoil=20=EC=84=A4=EC=B9=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - npm i recoil --- frontend/package-lock.json | 40 +++++++++++++++++++++++++++++++++++++- frontend/package.json | 3 ++- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 172098c..353742c 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -16,7 +16,8 @@ "phaser": "^3.55.2", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "^6.4.3" + "react-router-dom": "^6.4.3", + "recoil": "^0.7.6" }, "devDependencies": { "@emotion/babel-plugin": "^11.10.5", @@ -1350,6 +1351,11 @@ "node": ">=4" } }, + "node_modules/hamt_plus": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/hamt_plus/-/hamt_plus-1.0.2.tgz", + "integrity": "sha512-t2JXKaehnMb9paaYA7J0BX8QQAY8lwfQ9Gjf4pg/mk4krt+cmwmU652HOoWonf+7+EQV97ARPMhhVgU1ra2GhA==" + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -1682,6 +1688,25 @@ "react-dom": ">=16.8" } }, + "node_modules/recoil": { + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/recoil/-/recoil-0.7.6.tgz", + "integrity": "sha512-hsBEw7jFdpBCY/tu2GweiyaqHKxVj6EqF2/SfrglbKvJHhpN57SANWvPW+gE90i3Awi+A5gssOd3u+vWlT+g7g==", + "dependencies": { + "hamt_plus": "1.0.2" + }, + "peerDependencies": { + "react": ">=16.13.1" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + } + } + }, "node_modules/regenerator-runtime": { "version": "0.13.10", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.10.tgz", @@ -2771,6 +2796,11 @@ "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" }, + "hamt_plus": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/hamt_plus/-/hamt_plus-1.0.2.tgz", + "integrity": "sha512-t2JXKaehnMb9paaYA7J0BX8QQAY8lwfQ9Gjf4pg/mk4krt+cmwmU652HOoWonf+7+EQV97ARPMhhVgU1ra2GhA==" + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -3008,6 +3038,14 @@ "react-router": "6.4.3" } }, + "recoil": { + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/recoil/-/recoil-0.7.6.tgz", + "integrity": "sha512-hsBEw7jFdpBCY/tu2GweiyaqHKxVj6EqF2/SfrglbKvJHhpN57SANWvPW+gE90i3Awi+A5gssOd3u+vWlT+g7g==", + "requires": { + "hamt_plus": "1.0.2" + } + }, "regenerator-runtime": { "version": "0.13.10", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.10.tgz", diff --git a/frontend/package.json b/frontend/package.json index 2d5c07b..b187b5d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -17,7 +17,8 @@ "phaser": "^3.55.2", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "^6.4.3" + "react-router-dom": "^6.4.3", + "recoil": "^0.7.6" }, "devDependencies": { "@emotion/babel-plugin": "^11.10.5", From 8ada644a76decd4ea02d2ddb15b1a12d582a15ba Mon Sep 17 00:00:00 2001 From: ktmihs Date: Fri, 25 Nov 2022 17:26:59 +0900 Subject: [PATCH 2/4] =?UTF-8?q?[feat]=20#85=20user=20atom=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - nickname과 hair 상태 저장 --- frontend/src/store/atom/user.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 frontend/src/store/atom/user.ts diff --git a/frontend/src/store/atom/user.ts b/frontend/src/store/atom/user.ts new file mode 100644 index 0000000..22d400c --- /dev/null +++ b/frontend/src/store/atom/user.ts @@ -0,0 +1,14 @@ +import { atom } from 'recoil'; + +export interface userProps { + nickname: string; + hair: number; +} + +export const userState = atom({ + key: 'userState', + default: { + nickname: '', + hair: -1, + }, +}); From a21f0cf78c1fcd70c9d6bedf4e3df561c3b4caf9 Mon Sep 17 00:00:00 2001 From: ktmihs Date: Fri, 25 Nov 2022 17:27:52 +0900 Subject: [PATCH 3/4] =?UTF-8?q?[feat]=20#85=20=EB=B0=B0=EA=B2=BD=EC=9D=8C?= =?UTF-8?q?=EC=95=85=20=EB=B0=8F=20=EB=88=88=EB=82=B4=EB=A6=AC=EA=B8=B0=20?= =?UTF-8?q?=ED=9A=A8=EA=B3=BC=20=EC=83=81=ED=83=9C=20atom=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - musicState, snowState --- frontend/src/store/atom/backgroundSetting.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 frontend/src/store/atom/backgroundSetting.ts diff --git a/frontend/src/store/atom/backgroundSetting.ts b/frontend/src/store/atom/backgroundSetting.ts new file mode 100644 index 0000000..6883eae --- /dev/null +++ b/frontend/src/store/atom/backgroundSetting.ts @@ -0,0 +1,11 @@ +import { atom } from 'recoil'; + +export const musicState = atom({ + key: 'musicState', + default: true, +}); + +export const snowState = atom({ + key: 'snowState', + default: true, +}); From 402df3cb396a3dc857e5ea6fad7c26311abef25c Mon Sep 17 00:00:00 2001 From: ktmihs Date: Fri, 25 Nov 2022 17:33:51 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[feat]=20#85=20=EB=94=94=EB=B0=94=EC=9D=B4?= =?UTF-8?q?=EC=8A=A4=20atom=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 권한 atom, 종류 atom 생성 - devicePermissionState, devicesState --- frontend/src/store/atom/deviceSetting.ts | 16 ++++++++++++++++ frontend/src/types/types.ts | 4 ++++ 2 files changed, 20 insertions(+) create mode 100644 frontend/src/store/atom/deviceSetting.ts diff --git a/frontend/src/store/atom/deviceSetting.ts b/frontend/src/store/atom/deviceSetting.ts new file mode 100644 index 0000000..268f813 --- /dev/null +++ b/frontend/src/store/atom/deviceSetting.ts @@ -0,0 +1,16 @@ +import { atom } from 'recoil'; +import { stringObjectType } from '../../types/types'; + +export const devicePermissionState = atom({ + key: 'devicePermissionState', + default: false, +}); + +export const devicesState = atom({ + key: 'devicesState', + default: { + speaker: 'default', + audio: 'default', + video: 'default', + }, +}); diff --git a/frontend/src/types/types.ts b/frontend/src/types/types.ts index f6ad562..42d6243 100644 --- a/frontend/src/types/types.ts +++ b/frontend/src/types/types.ts @@ -1,3 +1,7 @@ export type childrenType = { children: JSX.Element | JSX.Element[]; }; + +export type stringObjectType = { + [key: string]: string; +};