Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recoil 설치 및 atom 생성 #86

Merged
merged 5 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
};