Skip to content

Commit 9a9e649

Browse files
authored
feat: DefaultMom 컴포넌트 구현 (#210)
1 parent 23bfbd3 commit 9a9e649

File tree

4 files changed

+70
-25
lines changed

4 files changed

+70
-25
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react';
2+
import GuideIcon from 'src/components/common/GuideIcon';
3+
import AmazedWabIcon from 'src/components/common/Icon/Wab/AmazedWabIcon';
4+
5+
import style from './style.module.scss';
6+
7+
function DefaultMom() {
8+
return (
9+
<div className={style['default-container']}>
10+
<AmazedWabIcon />
11+
<h1 className={style.message}>회의록이 텅텅 비었어요.</h1>
12+
<GuideIcon>
13+
<p>
14+
사이드바에서 <span className={style.highlight}>+ 회의록 추가</span>{' '}
15+
버튼을 클릭해 회의록을 추가해 보세요!
16+
</p>
17+
</GuideIcon>
18+
</div>
19+
);
20+
}
21+
22+
export default DefaultMom;

client/src/components/Mom/index.tsx

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import useSocketContext from 'src/hooks/useSocketContext';
77
import { v4 as uuid } from 'uuid';
88

99
import Block from './Block';
10+
import DefaultMom from './DefaultMom';
1011
import ee from './EventEmitter';
1112
import style from './style.module.scss';
1213

@@ -126,33 +127,29 @@ function Mom() {
126127
};
127128
}, []);
128129

129-
return (
130+
return selectedMom ? (
130131
<div className={style['mom-container']}>
131132
<div className={style['mom']}>
132-
{selectedMom ? (
133-
<>
134-
<div className={style['mom-header']}>
135-
<h1
136-
ref={titleRef}
137-
contentEditable={true}
138-
suppressContentEditableWarning={true}
139-
onInput={onTitleUpdate}
140-
>
141-
{selectedMom.title}
142-
</h1>
143-
<span>{new Date(selectedMom.createdAt).toLocaleString()}</span>
144-
</div>
145-
<div className={style['mom-body']}>
146-
{blocks.map((id, index) => (
147-
<Block key={id} id={id} index={index} onKeyDown={onKeyDown} />
148-
))}
149-
</div>
150-
</>
151-
) : (
152-
<h1>아직 회의록이 없어요. 만들어 보세요^^</h1>
153-
)}
133+
<div className={style['mom-header']}>
134+
<h1
135+
ref={titleRef}
136+
contentEditable={true}
137+
suppressContentEditableWarning={true}
138+
onInput={onTitleUpdate}
139+
>
140+
{selectedMom.title}
141+
</h1>
142+
<span>{new Date(selectedMom.createdAt).toLocaleString()}</span>
143+
</div>
144+
<div className={style['mom-body']}>
145+
{blocks.map((id, index) => (
146+
<Block key={id} id={id} index={index} onKeyDown={onKeyDown} />
147+
))}
148+
</div>
154149
</div>
155150
</div>
151+
) : (
152+
<DefaultMom />
156153
);
157154
}
158155

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,31 @@
4747
outline: none;
4848
}
4949
}
50+
51+
.default-container {
52+
display: flex;
53+
position: relative;
54+
flex-direction: column;
55+
align-items: center;
56+
justify-content: center;
57+
width: 100%;
58+
background-color: $off-white;
59+
60+
.message {
61+
margin: 20px;
62+
color: $primary-100;
63+
font-size: 20px;
64+
font-weight: 700;
65+
}
66+
67+
.highlight {
68+
margin: 0px 2px;
69+
70+
padding: 0px 5px;
71+
border-radius: 12px;
72+
background-color: $off-white;
73+
74+
color: $primary-100;
75+
font-weight: 700;
76+
}
77+
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@import 'styles/color.module';
22

33
.container {
4-
54
display: flex;
65
position: relative;
76
flex-direction: column;
@@ -11,7 +10,6 @@
1110
width: 100%;
1211

1312
.message {
14-
1513
margin: 20px;
1614
color: $primary-100;
1715
font-size: 20px;

0 commit comments

Comments
 (0)