Skip to content

Commit 7dea2e1

Browse files
authored
Feat/#93-K: 워크스페이스 사이드바 UI (#94)
* feat: 사이드바 레이아웃 마크업 Resolve #93 * refactor: 컴포넌트 분리 Resolve #93 * style: reset.scss에 box-sizing: border-box 추가 * refactor: 인라인 요소 span 태그로 변경 * refactor: 리스트 요소 ul 태그로 변경
1 parent 12cb10e commit 7dea2e1

File tree

13 files changed

+236
-33
lines changed

13 files changed

+236
-33
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import style from './style.module.scss';
2+
3+
function ConfButton() {
4+
return <button className={style['conf-button']}>회의시작</button>;
5+
}
6+
7+
export default ConfButton;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import style from './style.module.scss';
2+
3+
function MemberList() {
4+
const members = [
5+
{
6+
id: 1,
7+
name: '백도훈',
8+
avatarUrl: 'https://avatars.githubusercontent.com/u/65100540?s=60&v=4',
9+
},
10+
{
11+
id: 2,
12+
name: '백도훈',
13+
avatarUrl: 'https://avatars.githubusercontent.com/u/65100540?s=60&v=4',
14+
},
15+
];
16+
17+
return (
18+
<ul className={style['member-list']}>
19+
{members.map((item) => (
20+
<li key={item.id} className={style['member-item']}>
21+
<img src={item.avatarUrl} />
22+
<span>{item.name}</span>
23+
</li>
24+
))}
25+
</ul>
26+
);
27+
}
28+
29+
export default MemberList;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import style from './style.module.scss';
2+
3+
function MomList() {
4+
const moms = [
5+
{ id: 1, name: '회의록 1' },
6+
{ id: 2, name: '회의록 2' },
7+
{ id: 3, name: '회의록 3' },
8+
];
9+
10+
return (
11+
<div className={style['mom-list-container']}>
12+
<h2>회의록</h2>
13+
<ul className={style['mom-list']}>
14+
{moms.map((item) => (
15+
<li key={item.id}>{item.name}</li>
16+
))}
17+
</ul>
18+
<button>+ 회의록 추가</button>
19+
</div>
20+
);
21+
}
22+
23+
export default MomList;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { MdSettings } from '@react-icons/all-files/md/MdSettings';
2+
import WorkspaceSettingModal from 'components/WorkspaceSettingModal';
3+
import { useState } from 'react';
4+
5+
function SettingIcon() {
6+
const [isOpen, setIsOpen] = useState(false);
7+
8+
const onOpen = () => {
9+
setIsOpen(true);
10+
};
11+
12+
const onClose = () => {
13+
setIsOpen(false);
14+
};
15+
16+
return (
17+
<>
18+
<MdSettings size={15} onClick={onOpen} />
19+
{isOpen && (
20+
<WorkspaceSettingModal title="워크스페이스 설정" onClose={onClose} />
21+
)}
22+
</>
23+
);
24+
}
25+
26+
export default SettingIcon;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import ConfButton from './ConfButton';
2+
import MemberList from './MemberList';
3+
import MomList from './MomList';
4+
import SettingIcon from './SettingIcon';
5+
import style from './style.module.scss';
6+
7+
function Sidebar() {
8+
return (
9+
<div className={style['sidebar__container']}>
10+
<div className={style['header']}>
11+
<h1>왭^^</h1>
12+
<SettingIcon />
13+
</div>
14+
<MemberList />
15+
<MomList />
16+
<ConfButton />
17+
</div>
18+
);
19+
}
20+
21+
export default Sidebar;
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
@import 'styles/color.module.scss';
2+
3+
.sidebar__container {
4+
display: flex;
5+
flex-direction: column;
6+
align-items: center;
7+
8+
width: 252px;
9+
height: 100vh;
10+
}
11+
12+
@mixin container {
13+
display: flex;
14+
flex-direction: column;
15+
gap: 15px;
16+
width: 100%;
17+
box-sizing: border-box;
18+
padding: 25px;
19+
}
20+
21+
.header {
22+
@include container;
23+
flex-direction: row;
24+
align-items: center;
25+
justify-content: space-between;
26+
height: 72px;
27+
border-bottom: 1px solid $gray-300;
28+
29+
& > h1 {
30+
color: $black;
31+
font-size: 20px;
32+
font-weight: 500;
33+
}
34+
}
35+
36+
.member-list {
37+
@include container;
38+
border-bottom: 1px solid $gray-300;
39+
}
40+
41+
.member-item {
42+
width: 100%;
43+
display: flex;
44+
flex-direction: row;
45+
gap: 20px;
46+
align-items: center;
47+
justify-content: flex-start;
48+
49+
& > img {
50+
width: 40px;
51+
height: 40px;
52+
border-radius: 20px;
53+
}
54+
55+
& > p {
56+
color: $black;
57+
}
58+
}
59+
60+
.mom-list-container {
61+
@include container;
62+
63+
& > h2 {
64+
font-size: 18px;
65+
font-weight: 500;
66+
color: $black;
67+
}
68+
69+
& > button {
70+
font-size: 16px;
71+
text-align: start;
72+
color: $gray-100;
73+
}
74+
}
75+
76+
.mom-list {
77+
font-size: 16px;
78+
color: $gray-100;
79+
80+
& > li {
81+
margin-top: 15px;
82+
}
83+
84+
& > li:first-child {
85+
margin-top: 0px;
86+
}
87+
}
88+
89+
.conf-button {
90+
position: absolute;
91+
bottom: 20px;
92+
width: 80px;
93+
height: 25px;
94+
border-radius: 13px;
95+
background-color: $green;
96+
color: $white;
97+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Sidebar from 'components/Sidebar';
2+
3+
function Workspace() {
4+
return (
5+
<>
6+
<Sidebar />
7+
<div>
8+
{
9+
// 회의록과 화상회의 관련 컴포넌트
10+
}
11+
</div>
12+
</>
13+
);
14+
}
15+
16+
export default Workspace;

client/src/components/WorkspaceSetting/index.tsx

Lines changed: 0 additions & 26 deletions
This file was deleted.

client/src/components/WorkspaceSetting/SettingModal.tsx renamed to client/src/components/WorkspaceSettingModal/index.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
import { BiCodeBlock } from '@react-icons/all-files/bi/BiCodeBlock';
22
import { BiCopy } from '@react-icons/all-files/bi/BiCopy';
3-
import React from 'react';
43

54
import Button from '../common/Button';
65
import Modal from '../common/Modal';
76
import style from './style.module.scss';
87

9-
interface SettingModalProps {
8+
interface WorkspaceSettingModalProps {
109
title: string;
1110
onClose: () => void;
1211
}
1312

14-
function SettingModal({ title, onClose }: SettingModalProps) {
13+
function WorkspaceSettingModal({ title, onClose }: WorkspaceSettingModalProps) {
1514
const code = '1234';
1615

1716
const onClick = () => {
@@ -45,4 +44,4 @@ function SettingModal({ title, onClose }: SettingModalProps) {
4544
);
4645
}
4746

48-
export default SettingModal;
47+
export default WorkspaceSettingModal;

0 commit comments

Comments
 (0)