Skip to content

Commit f6d9877

Browse files
authored
Feat/#95-K: 회의록 UI (#96)
* feat: 사이드바 레이아웃 마크업 Resolve #93 * refactor: 컴포넌트 분리 Resolve #93 * style: reset.scss에 box-sizing: border-box 추가 * refactor: 인라인 요소 span 태그로 변경 * refactor: 리스트 요소 ul 태그로 변경 * feat: 회의록 컴포넌트 마크업 - contentEditable 속성의 변경은 input 이벤트로 감지 - 레이아웃 잡기위해 Confbar 컴포넌트도 추가 Resolve #95 * refactor: 태그 시맨틱 수정 회의록 헤더 컨테이너를 div로, 제목을 h1, 인라인 생성시간은 span으로 변경 * refactor: 셀렉터 네이밍 컨벤션에 맞춰 수정 * fix: suppressContentEditableWarning 옵션 추가 - WARNING 띄우는 이유는 리액트에서 컨트롤하지 못하는 변화이기 때문 - e.target.innerText로 값에 접근할 수 있지만 더 React-ish하게 사용하려면 ref를 활용 - state 사용해 controlled로 만들기 위해서는 렌더링 최적화, 제목 부분만 컴포넌트 분리 필요
1 parent 7dea2e1 commit f6d9877

File tree

9 files changed

+103
-9
lines changed

9 files changed

+103
-9
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function Confbar() {
2+
return <div></div>;
3+
}
4+
5+
export default Confbar;
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import style from './style.module.scss';
2+
3+
function Mom() {
4+
// context나 props로 가져오기
5+
const selectedMom = {
6+
id: 1,
7+
name: '회의록 1',
8+
createdAt: new Date(),
9+
};
10+
11+
/*
12+
contentEditable 내용을 컨트롤하고 싶다면 ref 활용해볼 수 있음
13+
const titleRef = useRef<HTMLHeadingElement>(null);
14+
*/
15+
16+
const onTitleChange: React.FormEventHandler<HTMLHeadingElement> = (e) => {
17+
/*
18+
제목 변경하는 요청
19+
const title = e.target as HTMLHeadingElement;
20+
title.innerText
21+
OR
22+
titleRef.current.innerText
23+
*/
24+
};
25+
26+
return (
27+
<div className={style['mom-container']}>
28+
<div className={style['mom']}>
29+
<div className={style['mom-header']}>
30+
<h1
31+
contentEditable={true}
32+
suppressContentEditableWarning={true}
33+
onInput={onTitleChange}
34+
>
35+
{selectedMom.name}
36+
</h1>
37+
<span>{selectedMom.createdAt.toLocaleString()}</span>
38+
</div>
39+
<div className={style['editor-container']}>회의록 내용</div>
40+
</div>
41+
</div>
42+
);
43+
}
44+
45+
export default Mom;
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
@import 'styles/color.module.scss';
2+
3+
.mom-container {
4+
display: flex;
5+
flex-direction: column;
6+
align-items: center;
7+
justify-content: flex-end;
8+
width: 100%;
9+
height: 100vh;
10+
background-color: $off-white;
11+
}
12+
13+
.mom {
14+
position: relative;
15+
width: 90%;
16+
height: calc(100% - 30px);
17+
}
18+
19+
.mom-header {
20+
display: flex;
21+
flex-direction: row;
22+
align-items: baseline;
23+
justify-content: space-between;
24+
height: 70px;
25+
padding: 0px 15px 20px 15px;
26+
box-sizing: border-box;
27+
color: $gray-100;
28+
29+
& > h1 {
30+
font-size: 32px;
31+
font-weight: 500;
32+
33+
&:focus {
34+
outline: none;
35+
}
36+
}
37+
}
38+
39+
.editor-container {
40+
height: calc(100% - 70px);
41+
padding: 20px;
42+
box-sizing: border-box;
43+
background-color: white;
44+
}

client/src/components/Sidebar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import style from './style.module.scss';
66

77
function Sidebar() {
88
return (
9-
<div className={style['sidebar__container']}>
9+
<div className={style['sidebar-container']}>
1010
<div className={style['header']}>
1111
<h1>왭^^</h1>
1212
<SettingIcon />

client/src/components/Sidebar/style.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@import 'styles/color.module.scss';
22

3-
.sidebar__container {
3+
.sidebar-container {
44
display: flex;
55
flex-direction: column;
66
align-items: center;

client/src/components/Workspace/index.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1+
import Confbar from 'components/Confbar';
2+
import Mom from 'components/Mom';
13
import Sidebar from 'components/Sidebar';
24

35
function Workspace() {
46
return (
57
<>
68
<Sidebar />
7-
<div>
8-
{
9-
// 회의록과 화상회의 관련 컴포넌트
10-
}
11-
</div>
9+
<Mom />
10+
<Confbar />
1211
</>
1312
);
1413
}

client/src/components/WorkspaceList/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function WorkspaceList() {
4343

4444
return (
4545
<SetWorkspacesContext.Provider value={setWorkspaces}>
46-
<div className={style.workspace__container}>
46+
<div className={style['workspace-list-container']}>
4747
<WorkspaceThumbnaliList workspaces={workspaces} />
4848
<Selector
4949
TriggerElement={AddButton}

client/src/components/WorkspaceList/style.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@import 'styles/color.module.scss';
22

3-
.workspace__container {
3+
.workspace-list-container {
44
position: relative;
55

66
background-color: $primary-100;

client/src/styles/color.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
$primary-100: #323845;
22
$white: #fff;
3+
$off-white: #f5f5f5;
34
$black: #474747;
45
$gray-100: #5c5c5c;
56
$gray-200: #bbbbbb;

0 commit comments

Comments
 (0)