Skip to content

Commit

Permalink
Merge pull request #86 from ktmihs/develop
Browse files Browse the repository at this point in the history
recoil 설치 및 atom 생성
  • Loading branch information
comeintostout authored Nov 25, 2022
2 parents 50d223e + 337c28d commit 7ca1402
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 2 deletions.
40 changes: 39 additions & 1 deletion frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 11 additions & 0 deletions frontend/src/store/atom/backgroundSetting.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { atom } from 'recoil';

export const musicState = atom<boolean>({
key: 'musicState',
default: true,
});

export const snowState = atom<boolean>({
key: 'snowState',
default: true,
});
16 changes: 16 additions & 0 deletions frontend/src/store/atom/deviceSetting.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { atom } from 'recoil';
import { stringObjectType } from '../../types/types';

export const devicePermissionState = atom<boolean>({
key: 'devicePermissionState',
default: false,
});

export const devicesState = atom<stringObjectType>({
key: 'devicesState',
default: {
speaker: 'default',
audio: 'default',
video: 'default',
},
});
14 changes: 14 additions & 0 deletions frontend/src/store/atom/user.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { atom } from 'recoil';

export interface userProps {
nickname: string;
hair: number;
}

export const userState = atom<userProps>({
key: 'userState',
default: {
nickname: '',
hair: -1,
},
});
4 changes: 4 additions & 0 deletions frontend/src/types/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
export type childrenType = {
children: JSX.Element | JSX.Element[];
};

export type stringObjectType = {
[key: string]: string;
};

0 comments on commit 7ca1402

Please sign in to comment.