Skip to content

Commit 586b169

Browse files
committed
Chore: 메인 전체 요약본 디자인
1 parent 238271d commit 586b169

File tree

5 files changed

+63
-15
lines changed

5 files changed

+63
-15
lines changed

src/assets/imgs/icon/del.svg

Lines changed: 5 additions & 0 deletions
Loading

src/assets/imgs/icon/dwn.svg

Lines changed: 5 additions & 0 deletions
Loading

src/views/main/components/SideBar.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import test from "@/assets/imgs/common/test.png";
77
import { useState, useEffect } from "react";
88
import { useNavigate, useLocation } from 'react-router-dom';
99
import { Link } from "react-router-dom";
10-
import path from "path";
1110

1211
const SideBar = () => {
1312
const [sort, setSort] = useState<string>("/");

src/views/main/page/RecordPage.tsx

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ import arrow from "@/assets/imgs/icon/arrow_down_black.svg";
55
// component
66
import SideBar from "@/views/main/components/SideBar";
77

8-
import { useState } from "react";
8+
import { useState, useEffect } from "react";
99
import { Link } from "react-router-dom";
1010

1111
const RecordPage = () => {
1212
const [tab, setTab] = useState<string>("all");
1313
const [order, setOrder] = useState<boolean>(true);
1414
const [showOrder, setShowOrder] = useState<boolean>(false);
15+
const [isCheck, setIsCheck] = useState<boolean>(false);
16+
const [checkCount, setCheckCount] = useState<number>(0);
1517

1618
const [data, setData] = useState([
1719
{ id: 1, name: "test1", date: "", user: "", time: "", size: "", selected: false },
@@ -37,6 +39,13 @@ const RecordPage = () => {
3739
setData(newData);
3840
};
3941

42+
useEffect(() => {
43+
setIsCheck(data.some(row => row.selected));
44+
const count = data.filter(row => row.selected).length;
45+
setCheckCount(count);
46+
}, [data]);
47+
48+
4049
return (
4150
<div className="main">
4251
<SideBar />
@@ -73,10 +82,23 @@ const RecordPage = () => {
7382
<table>
7483
<thead>
7584
<tr>
76-
<th>
77-
<input type="checkbox" checked={isAllSelected} onChange={handleSelectAll}/>
85+
<th onClick={handleSelectAll}>
86+
<input type="checkbox" checked={isAllSelected}/>
7887
</th>
79-
<th>회의 이름</th>
88+
{
89+
isCheck ? (
90+
<th>
91+
<div className="craft-wrap">
92+
<div>{ checkCount }개 선택됨</div>
93+
<button className="dwn">다운로드 하기</button>
94+
<button className="del">삭제하기</button>
95+
<button className="cancel">취소</button>
96+
</div>
97+
</th>
98+
) : (
99+
<th>회의 이름</th>
100+
)
101+
}
80102
<th>생성일</th>
81103
<th>생성자</th>
82104
<th>음성 길이</th>
@@ -85,12 +107,11 @@ const RecordPage = () => {
85107
</thead>
86108
<tbody>
87109
{data.map((row) => (
88-
<tr key={row.id}>
110+
<tr key={row.id} onClick={() => handleSelectRow(row.id)}>
89111
<td>
90112
<input
91113
type="checkbox"
92114
checked={row.selected}
93-
onChange={() => handleSelectRow(row.id)}
94115
/>
95116
</td>
96117
<td>{row.name}</td>

src/views/main/style/record.sass

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,31 @@
9191

9292
table
9393
+size(100%)
94-
95-
th
96-
color: $gray-600
9794

98-
th, td
99-
+padding(8px)
100-
text-align: left
95+
tr
96+
cursor: pointer
97+
98+
&:not(:has(th)):hover
99+
border-radius: 8px
100+
background-color: $gray-100
101+
102+
th
103+
color: $gray-600
104+
105+
.craft-wrap
106+
+flex-box(normal, center)
107+
108+
.dwn
109+
+btn()
110+
+flex-box(center, center, 2px)
111+
112+
&:before
113+
+size(16px, 16px)
114+
content : url('@/assets/imgs/icon/dwn.svg')
115+
116+
th, td
117+
+padding(8px)
118+
text-align: left
101119

102-
&:first-child
103-
+size(20px)
120+
&:first-child
121+
+size(20px)

0 commit comments

Comments
 (0)