Skip to content

Commit

Permalink
[refactor] #66 친구 상태에 busy를 추가하여 활성 상태 색상 표시
Browse files Browse the repository at this point in the history
- busy일 때는 노란색으로 표시
  • Loading branch information
ktmihs committed Dec 8, 2022
1 parent c684751 commit 27e8a5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/src/component/Sidebar/Friends/friendItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const FriendItem = ({ friend }: { friend: friendType }) => {
return (
<Content draggable={isOnline}>
<section id={id} css={friendItemWrapper(isOnline)}>
<div css={userName(isOnline)}>{nickname}</div>
<div css={userName(status)}>{nickname}</div>
<div>
<button onClick={sendChatting}>
<img src={message} alt="채팅하기 버튼"></img>
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/component/Sidebar/Friends/friends.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const friendItemWrapper = (isOnline: boolean) => css`
}
`;

export const userName = (state: boolean) => css`
export const userName = (state: string) => css`
font-weight: 700;
::before {
Expand All @@ -76,7 +76,11 @@ export const userName = (state: boolean) => css`
width: 10px;
height: 10px;
border-radius: 5px;
background-color: ${state ? theme.green : theme.red};
background-color: ${state === 'online'
? theme.green
: state === 'offline'
? theme.red
: theme.yellow};
}
`;

Expand Down

0 comments on commit 27e8a5f

Please sign in to comment.