Skip to content

Commit

Permalink
[feat] boostcampwm-2022#66 boostcampwm-2022#85 친구 목록 전역으로 저장
Browse files Browse the repository at this point in the history
- 친구 목록을 전역으로 저장하여 관리
  • Loading branch information
ktmihs committed Nov 30, 2022
1 parent f6ff43a commit c516aca
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
1 change: 1 addition & 0 deletions frontend/src/component/Sidebar/Friends/friends.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export type friendType = {
id: string;
isCalling: boolean;
isOnline: boolean;
name: string;
};
64 changes: 64 additions & 0 deletions frontend/src/store/atom/friends.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { atom } from 'recoil';

export interface friendsProps {
[key: string]: {
id: string;
name: string;
isOnline: boolean;
isCalling: boolean;
};
}

export const friendsState = atom<friendsProps>({
key: 'friendsState',
default: {
'1': {
id: '1',
isOnline: false,
name: '안현서',
isCalling: false,
},
'2': {
id: '2',
isOnline: true,
name: '원종빈',
isCalling: true,
},
'3': {
id: '3',
isOnline: true,
name: '강성준',
isCalling: true,
},
'4': {
id: '4',
isOnline: true,
name: '이형진',
isCalling: false,
},
'5': {
id: '5',
isOnline: false,
name: '안현서',
isCalling: false,
},
'6': {
id: '6',
isOnline: false,
name: '원종빈',
isCalling: false,
},
'7': {
id: '7',
isOnline: true,
name: '강성준',
isCalling: false,
},
'8': {
id: '8',
isOnline: true,
name: '이형진',
isCalling: false,
},
},
});

0 comments on commit c516aca

Please sign in to comment.