Skip to content

Commit 115ea95

Browse files
committed
style: VoteMode.CREATE 뷰 수정
1 parent bb4591d commit 115ea95

File tree

1 file changed

+53
-50
lines changed

1 file changed

+53
-50
lines changed

client/src/components/Block/VoteBlock/VoteBlockTemplate.tsx

Lines changed: 53 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -144,65 +144,68 @@ function VoteBlockTemplate({
144144

145145
return (
146146
<div className={style['vote-container']}>
147-
<h3 className={style.title}>
148-
{isCreateMode ? '투표 등록중 ^^' : '투표'}
149-
</h3>
147+
<h3 className={style.title}>{'투표'}</h3>
150148
{(isRegisteredMode || isEndMode) && (
151149
<span className={style['participant-cnt']}>
152150
{participantCount}명 참여
153151
</span>
154152
)}
155-
{isCreateMode ? (
156-
<></>
157-
) : (
153+
{
158154
<ul>
159-
{options.map(({ id, text, count }, index) => (
160-
<li
161-
className={cx('option-item', {
162-
'selected-item':
163-
(isRegisteredMode || isEndMode) && id === selectedOptionId,
164-
})}
165-
key={id}
166-
onClick={() => onSelect(id)}
167-
>
168-
{isEndMode && (
169-
<div
170-
className={style['vote-result-bar']}
171-
style={{
172-
width: `${getPercent(count)}%`,
173-
backgroundColor: color.highlight100,
174-
}}
175-
></div>
176-
)}
177-
178-
<div className={style['box-fill']}>{index + 1}</div>
179-
<input
180-
type="text"
181-
className={cx('option-input', {
182-
selected: isRegisteredMode,
155+
{isCreateMode ? (
156+
<li className={style['option-item']}>
157+
<div className={style['box-fill']}>{'^^'}</div>
158+
<div>등록될 때까지 기다려주세요</div>
159+
</li>
160+
) : (
161+
options.map(({ id, text, count }, index) => (
162+
<li
163+
className={cx('option-item', {
164+
'selected-item':
165+
(isRegisteredMode || isEndMode) && id === selectedOptionId,
183166
})}
184-
placeholder="항목을 입력해주세요"
185-
onChange={onChange}
186-
data-id={id}
187-
readOnly={isRegisteredMode || isEndMode}
188-
defaultValue={text}
189-
/>
190-
{isRegisteringMode && (
191-
<Button
192-
icon={<BiX size="20" color="white" />}
193-
ariaLabel="항목 삭제"
194-
onClick={() => onDelete(id)}
167+
key={id}
168+
onClick={() => onSelect(id)}
169+
>
170+
{isEndMode && (
171+
<div
172+
className={style['vote-result-bar']}
173+
style={{
174+
width: `${getPercent(count)}%`,
175+
backgroundColor: color.highlight100,
176+
}}
177+
></div>
178+
)}
179+
180+
<div className={style['box-fill']}>{index + 1}</div>
181+
<input
182+
type="text"
183+
className={cx('option-input', {
184+
selected: isRegisteredMode,
185+
})}
186+
placeholder="항목을 입력해주세요"
187+
onChange={onChange}
188+
data-id={id}
189+
readOnly={isRegisteredMode || isEndMode}
190+
defaultValue={text}
195191
/>
196-
)}
197-
{isEndMode && (
198-
<div className={style['vote-result-text']}>
199-
{getVoteResultText(count)}
200-
</div>
201-
)}
202-
</li>
203-
))}
192+
{isRegisteringMode && (
193+
<Button
194+
icon={<BiX size="20" color="white" />}
195+
ariaLabel="항목 삭제"
196+
onClick={() => onDelete(id)}
197+
/>
198+
)}
199+
{isEndMode && (
200+
<div className={style['vote-result-text']}>
201+
{getVoteResultText(count)}
202+
</div>
203+
)}
204+
</li>
205+
))
206+
)}
204207
</ul>
205-
)}
208+
}
206209
<div className={style['vote-buttons']}>
207210
{isRegisteringMode && (
208211
<>

0 commit comments

Comments
 (0)