-
Notifications
You must be signed in to change notification settings - Fork 2
[FE] FEAT: 유저리스트 정렬 관리 #161 #171
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
Merged
Merged
Changes from 9 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
3668c45
[FE] FEAT: 유저리스트 정렬 및 추가 삭제를 위한 레드블랙트리 #161
juwon5272 816b9cc
[FE] REFACTOR: 스크롤 추가
juwon5272 29259dc
[FE] FEAT: 유저리스트에 레드블랙트리 적용 및 테스트용 버튼 추가 #161
juwon5272 5497860
[FE] REFACTOR: 멤버리스트 목록과 보이스챗 목록 컴포넌트 분리 #161
juwon5272 2a09b56
[FE] REFACTOR: switch문 객체 리터럴 방식으로 변경 #161
juwon5272 8d2e974
[FE] FIX: 타입스크립트 오류 해결
juwon5272 421ed56
[FE] REFACTOR: red-black tree만 따로 분리 #161
juwon5272 4645b96
[FE] REFACTOR: red-black tree 따로 분리 #161
juwon5272 42a7d4c
[FE] FEAT: Red-Black Tree를 다른 자료구조로 변환해서 사용하지 않게 변경 #161
juwon5272 4d3e057
[FE] REFACTOR: util이 아닌 부분 MemberList로 옮기기 #161
juwon5272 e46acb8
[FE] REFACTOR: sort 과정 분리
juwon5272 fa7ec91
[FE] REFACTOR: 변수및 파일명 UserList로 변경
juwon5272 83c5b4b
[FE] DELETE: 불필요한 파일 삭제
juwon5272 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
src/frontend/src/components/Sidebar/VoiceChat/index.css.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| import styled from 'styled-components'; | ||
|
|
||
| export const Container = styled.div` | ||
| height: 100%; | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| justify-content: space-between; | ||
| `; | ||
|
|
||
| export const UserList = styled.div` | ||
| display: flex; | ||
| flex-direction: column; | ||
| width: 100%; | ||
| overflow-y: auto; | ||
| `; | ||
|
|
||
| export const MemberFooter = styled.div` | ||
| width: 100%; | ||
| display: flex; | ||
| align-items: center; | ||
| padding: 8px 0; | ||
|
|
||
| border-top: 1px solid #d4d4d4; | ||
| `; | ||
|
|
||
| export const VoiceChatFooter = styled.div` | ||
| width: 100%; | ||
| display: flex; | ||
| justify-content: space-around; | ||
| padding: 8px 0px; | ||
| border-top: 1px solid #d4d4d4; | ||
| `; | ||
|
|
||
| export const ActionButton = styled.button` | ||
| border: none; | ||
| padding: 10px; | ||
| border-radius: 50%; | ||
| background-color: #f4f4f4; | ||
| cursor: pointer; | ||
| `; | ||
|
|
||
| export const JoinButton = styled.button` | ||
| width: 194px; | ||
| border: none; | ||
| background-color: #ff9100; | ||
| padding: 10px 20px; | ||
| color: white; | ||
| font-weight: bold; | ||
| border-radius: 5px; | ||
| cursor: pointer; | ||
| `; | ||
|
|
||
| export const ProfileWrapper = styled.div` | ||
| position: relative; | ||
| cursor: pointer; | ||
|
|
||
| & .profile-detail { | ||
| position: absolute; | ||
| top: 0px; | ||
| right: 60%; | ||
| transform: translateX(-50%); | ||
| opacity: 0; | ||
| visibility: hidden; | ||
| transition: | ||
| opacity 0.3s ease, | ||
| visibility 0.3s ease; | ||
| z-index: 10; | ||
| } | ||
|
|
||
| .profile-detail.active { | ||
| opacity: 1; | ||
| visibility: visible; | ||
| } | ||
| `; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| import { useState } from 'react'; | ||
| import { SmallProfile } from '@/components/common/SmallProfile'; | ||
| import { ProfileDetail } from '@/components/common/ProfileDetail'; | ||
| import { MemberListFooter } from '@/components/Sidebar/MemberList/MemberListFooter'; | ||
|
|
||
| import { SidebarType } from '@/types/enums/SidebarType'; | ||
| import { ProfileType } from '@/types/enums/ProfileType'; | ||
| import { UserRole } from '@/types/enums/UserRole'; | ||
| import { memberListTest } from '@/assets/data/memberListTest'; | ||
|
|
||
| import { Container, UserList, ProfileWrapper } from './index.css'; | ||
|
|
||
| export const VoiceChat = () => { | ||
| const [activeProfile, setActiveProfile] = useState<number | null>(null); | ||
| const handleProfileClick = (id: number) => { | ||
| setActiveProfile(prevId => (prevId === id ? null : id)); | ||
| }; | ||
|
|
||
| return ( | ||
| <Container> | ||
| <UserList> | ||
| {memberListTest | ||
| .sort((a, b) => a.role - b.role) | ||
| .map(member => ( | ||
juwon5272 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <ProfileWrapper key={member.id}> | ||
| <div onClick={() => handleProfileClick(member.id)}> | ||
| <SmallProfile | ||
| type={ProfileType.VOICECHAT} | ||
| role={member.role} | ||
| nickname={member.nickname} | ||
| imgUrl={member.profileImg} | ||
| /> | ||
| </div> | ||
| {activeProfile === member.id ? ( | ||
| <div className={`profile-detail ${activeProfile === member.id ? 'active' : ''}`}> | ||
| <ProfileDetail | ||
| userId={member.id} | ||
| userRole={member.role} | ||
| myRole={UserRole.CREATOR} | ||
| sidebarType={SidebarType.VOICECHAT} | ||
| /> | ||
| </div> | ||
| ) : ( | ||
| '' | ||
| )} | ||
| </ProfileWrapper> | ||
| ))} | ||
| </UserList> | ||
| <MemberListFooter sidebarType={SidebarType.VOICECHAT} /> | ||
| </Container> | ||
| ); | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.