-
Notifications
You must be signed in to change notification settings - Fork 3
허들레이아웃 구현 #133
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
허들레이아웃 구현 #133
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
8db1ce9
#112 feat(fe): 허들 컨테이너 구현
handje adbef23
#112 feat(fe): 허들 콘텐츠, 컨트롤러 파일 생성
handje 20898f1
#112 feat(fe): 허들 콘텐츠 레이아웃 구현
handje 4ceebce
#112 feat(fe): 허들 콘텐츠 참가자 아바타 구현
handje 334c43a
#112 feat(fe): 허들 컨트롤 컨테이너
handje f0fc652
#112 fix(fe): toggle스타일링 수정
handje a81aba0
#112 fix(fe): toggle그룹 스타일링 수정
handje f08781b
#112 fix(fe): 대댓글 아이콘 스타일링 수정
handje 406fdb1
#112 fix(fe): 참여자 아이콘 스타일링 수정
handje 889cd4e
#112 feat(fe):export 및 테스트 페이지 생성
handje 1f8ee53
#112 fix(fe): 파일명 수정
handje 6e3da56
#112 feat(fe): control state reducer 구현
handje 32172b4
#112 feat(fe): control union type 분리
handje 2f2158b
#112 feat(fe): ToggleItem컴포넌트 분리
handje 45703e7
#112 refactor(fe): icon객체화 및 적용
handje 8cc9ae3
#112 refactor(fe):타입 수정 및 불필요한 코드 삭제
handje 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import HuddleContainer from '@/src/features/video/ui/huddle-container'; | ||
|
|
||
| //허들 테스트를 위한 임시페이지(삭제예정) | ||
| const HuddleTest = () => { | ||
| return <HuddleContainer />; | ||
| }; | ||
| export default HuddleTest; |
Empty file.
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 @@ | ||
| export { default as HuddleContainer } from './ui/huddle-container'; |
5 changes: 5 additions & 0 deletions
5
src/frontend/apps/web/src/features/video/model/huddle-control.type.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,5 @@ | ||
| export enum HuddleControl { | ||
| Mic = 'mic', | ||
| Video = 'video', | ||
| Screen = 'screen', | ||
| } |
16 changes: 16 additions & 0 deletions
16
src/frontend/apps/web/src/features/video/model/huddle-controls-reducer.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,16 @@ | ||
| import { type HuddleControl } from './huddle-control.type'; | ||
|
|
||
| export type HuddleControlsState = { | ||
| [HuddleControl.Mic]: boolean; | ||
| [HuddleControl.Video]: boolean; | ||
| [HuddleControl.Screen]: boolean; | ||
| }; | ||
|
|
||
| export type HuddleControlAction = { | ||
| type: HuddleControl; | ||
| }; | ||
|
|
||
| export const huddleControlReducer = ( | ||
handje marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| state: HuddleControlsState, | ||
| action: HuddleControlAction, | ||
| ) => ({ ...state, [action.type]: !state[action.type] }); | ||
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,6 @@ | ||
| export { HuddleControl } from './huddle-control.type'; | ||
| export { | ||
| type HuddleControlsState, | ||
| type HuddleControlAction, | ||
| huddleControlReducer, | ||
| } from './huddle-controls-reducer'; |
20 changes: 20 additions & 0 deletions
20
src/frontend/apps/web/src/features/video/ui/huddle-container.tsx
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,20 @@ | ||
| import { Headphones } from 'lucide-react'; | ||
| import HuddleContent from './huddle-section'; | ||
| import ControlsContainer from './huddle-footer'; | ||
|
|
||
| const HuddleContainer = () => { | ||
| return ( | ||
| <div className="bg-primary w-full h-full flex flex-col gap-1 px-2 py-1"> | ||
| <h3 className="flex flex-row text-white gap-2"> | ||
| <Headphones /> slack-전체에서의 허들 1명 | ||
| </h3> | ||
| <div className="min-h-0 h-[90%]"> | ||
| <HuddleContent /> | ||
| </div> | ||
| <div className="min-h-0 h-[10%]"> | ||
| <ControlsContainer /> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
| export default HuddleContainer; |
25 changes: 25 additions & 0 deletions
25
src/frontend/apps/web/src/features/video/ui/huddle-control-item.tsx
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,25 @@ | ||
| import { ToggleGroupItem } from '@workspace/ui/components'; | ||
| import { HuddleControl, HuddleControlAction } from '../model'; | ||
| import { Dispatch } from 'react'; | ||
|
|
||
| type HuddleControlProps = { | ||
| value: HuddleControl; | ||
| children: React.ReactNode; | ||
| dispatch: Dispatch<HuddleControlAction>; | ||
| }; | ||
|
|
||
| const HuddleControlItem = ({ | ||
| value, | ||
| children, | ||
| dispatch, | ||
| }: HuddleControlProps) => { | ||
| return ( | ||
| <ToggleGroupItem | ||
| value={value} | ||
| onClick={() => dispatch({ type: value })} | ||
| > | ||
| {children} | ||
| </ToggleGroupItem> | ||
| ); | ||
| }; | ||
| export default HuddleControlItem; |
63 changes: 63 additions & 0 deletions
63
src/frontend/apps/web/src/features/video/ui/huddle-controls-group.tsx
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,63 @@ | ||
| 'use client'; | ||
| import { Button, ToggleGroup } from '@workspace/ui/components'; | ||
| import { | ||
| Mic, | ||
| MicOff, | ||
| ScreenShare, | ||
| ScreenShareOff, | ||
| Video, | ||
| VideoOff, | ||
| } from 'lucide-react'; | ||
| import { useReducer } from 'react'; | ||
| import HuddleControlItem from './huddle-control-item'; | ||
| import { HuddleControl, huddleControlReducer } from '../model'; | ||
|
|
||
| export const controlIconList = { | ||
| [HuddleControl.Mic]: { on: <Mic />, off: <MicOff /> }, | ||
| [HuddleControl.Video]: { on: <Video />, off: <VideoOff /> }, | ||
| [HuddleControl.Screen]: { on: <ScreenShare />, off: <ScreenShareOff /> }, | ||
| } as const; | ||
|
|
||
| const HuddleControlsGroup = () => { | ||
| const [controlGroupState, controlGroupDispatch] = useReducer( | ||
| huddleControlReducer, | ||
| { | ||
| [HuddleControl.Mic]: false, | ||
| [HuddleControl.Video]: false, | ||
| [HuddleControl.Screen]: false, | ||
| }, | ||
| ); | ||
|
|
||
| return ( | ||
| <div className="flex justify-center items-center"> | ||
| <ToggleGroup | ||
| variant="default" | ||
| type="multiple" | ||
| size="lg" | ||
| className="gap-3" | ||
| > | ||
| {Object.entries(controlIconList).map(([key, component]) => { | ||
| const controlKey = key as HuddleControl; | ||
| return ( | ||
| <HuddleControlItem | ||
| key={key} | ||
| value={controlKey} | ||
| dispatch={controlGroupDispatch} | ||
| > | ||
| {component[controlGroupState[controlKey] ? 'on' : 'off']} | ||
| </HuddleControlItem> | ||
| ); | ||
| })} | ||
|
|
||
| <Button | ||
| variant="destructive" | ||
| size="lg" | ||
| className="h-12 font-bold" | ||
| > | ||
| 나가기 | ||
| </Button> | ||
| </ToggleGroup> | ||
| </div> | ||
| ); | ||
| }; | ||
| export default HuddleControlsGroup; |
19 changes: 19 additions & 0 deletions
19
src/frontend/apps/web/src/features/video/ui/huddle-footer.tsx
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,19 @@ | ||
| import { Toggle } from '@workspace/ui/components'; | ||
| import HuddleControlsGroup from './huddle-controls-group'; | ||
| import { MessageSquareText } from 'lucide-react'; | ||
|
|
||
| const HuddleFooter = () => { | ||
| return ( | ||
| <div className="relative w-full h-full min-w-0 min-h-0 flex flex-row justify-center items-center"> | ||
| <HuddleControlsGroup /> | ||
| <Toggle | ||
| variant="default" | ||
| size="lg" | ||
| className="absolute right-0" | ||
| > | ||
| <MessageSquareText /> | ||
| </Toggle> | ||
| </div> | ||
| ); | ||
| }; | ||
| export default HuddleFooter; |
14 changes: 14 additions & 0 deletions
14
src/frontend/apps/web/src/features/video/ui/huddle-participant-avatar.tsx
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,14 @@ | ||
| import { Avatar, AvatarFallback, AvatarImage } from '@workspace/ui/components'; | ||
|
|
||
| const HuddleParticipantAvatar = () => { | ||
| return ( | ||
| <Avatar | ||
| variant="square" | ||
| className="w-full h-full" | ||
| > | ||
| <AvatarImage src="https://github.com/shadcn.png" /> | ||
| <AvatarFallback className="bg-gray-300">user profile</AvatarFallback> | ||
| </Avatar> | ||
| ); | ||
| }; | ||
| export default HuddleParticipantAvatar; |
11 changes: 11 additions & 0 deletions
11
src/frontend/apps/web/src/features/video/ui/huddle-participant-card.tsx
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,11 @@ | ||
| import HuddleParticipantAvatar from './huddle-participant-avatar'; | ||
|
|
||
| const HuddleParticipantCard = () => { | ||
| // 참여자 카메라 화면 또는 아바타가 보여질 예정 | ||
| return ( | ||
| <div className="h-[45%] aspect-square rounded-md overflow-hidden"> | ||
| <HuddleParticipantAvatar /> | ||
| </div> | ||
| ); | ||
| }; | ||
| export default HuddleParticipantCard; |
13 changes: 13 additions & 0 deletions
13
src/frontend/apps/web/src/features/video/ui/huddle-section.tsx
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,13 @@ | ||
| import HuddleParticipant from './huddle-participant-card'; | ||
|
|
||
| const HuddleSection = () => { | ||
| return ( | ||
| <div className="w-full h-full min-h-0 overflow-hidden p-3 bg-muted rounded-lg flex flex-row flex-wrap justify-center items-center gap-5 overflow-y-auto"> | ||
| <HuddleParticipant /> | ||
| <HuddleParticipant /> | ||
| {/* <HuddleParticipant /> | ||
| <HuddleParticipant /> */} | ||
| </div> | ||
| ); | ||
| }; | ||
| export default HuddleSection; |
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
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.