Skip to content

Commit e13ec6e

Browse files
committed
feat: klmhyeonwoo#22 아젠다 상태창 추가
1 parent e3f23aa commit e13ec6e

File tree

5 files changed

+94
-6
lines changed

5 files changed

+94
-6
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"react-calendar": "^5.0.0",
2222
"react-dom": "^18.2.0",
2323
"react-router-dom": "^6.22.3",
24-
"swiper": "^11.1.1"
24+
"swiper": "^11.1.3"
2525
},
2626
"devDependencies": {
2727
"@types/lodash": "^4.17.1",

pnpm-lock.yaml

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/main/index.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import moment from "moment";
2828
import "moment/locale/ko";
2929
import { Beforeunload } from "react-beforeunload";
3030
import NotDataWithContentBox from "@/component/common/NotDataWithContentBox.tsx";
31+
import StatusBar from "@/component/main/StatusBar.tsx";
3132

3233
export type ValuePiece = Date | null;
3334
export type Value = ValuePiece | [ValuePiece, ValuePiece];
@@ -231,6 +232,7 @@ export default function Main() {
231232
text-align: center;
232233
`}
233234
/>
235+
<StatusBar todoList={todo} completeList={complete} />
234236
</ContentBox>
235237
</div>
236238
<ContentBox

src/component/main/Performence.tsx

+12-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import telemechine3D from "@/assets/3d/performence/telemechine.gif";
1515

1616
import { css } from "@emotion/react";
1717
import { Swiper, SwiperSlide } from "swiper/react";
18+
import { Autoplay } from "swiper/modules";
19+
1820
import "swiper/css";
1921
import { DESIGN_SYSTEM_COLOR } from "@/style/variable.ts";
2022
import { useRef } from "react";
@@ -41,7 +43,16 @@ export default function Performence() {
4143

4244
return (
4345
<div>
44-
<Swiper spaceBetween={30} slidesPerView={3}>
46+
<Swiper
47+
modules={[Autoplay]}
48+
spaceBetween={30}
49+
slidesPerView={3.5}
50+
autoplay={{
51+
delay: 1500,
52+
disableOnInteraction: false,
53+
}}
54+
loop={true}
55+
>
4556
{mock.map((item) => {
4657
const key = useRef(Math.floor(Math.random() * GRAPHIC_LIST.length));
4758
return (

src/component/main/StatusBar.tsx

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import { css } from "@emotion/react";
2+
import { DESIGN_SYSTEM_COLOR } from "@/style/variable.ts";
3+
import { agendaProps } from "@/app/main";
4+
5+
interface statusDataProps {
6+
todoList: agendaProps[];
7+
completeList: agendaProps[];
8+
}
9+
export default function StatusBar({ todoList, completeList }: statusDataProps) {
10+
return (
11+
<div
12+
css={css`
13+
display: flex;
14+
flex-direction: column;
15+
row-gap: 1.5rem;
16+
width: 100%;
17+
`}
18+
>
19+
<div
20+
css={css`
21+
position: relative;
22+
width: 100%;
23+
border-radius: 0.7rem;
24+
height: 0.8rem;
25+
background-color: ${DESIGN_SYSTEM_COLOR.grey100};
26+
`}
27+
>
28+
<div
29+
css={css`
30+
position: absolute;
31+
width: ${(completeList.length / (todoList.length + completeList.length)) * 100}%;
32+
border-radius: 0.7rem;
33+
height: 0.8rem;
34+
background-color: ${DESIGN_SYSTEM_COLOR.kreamBlack};
35+
transition: 0.4s all;
36+
`}
37+
/>
38+
</div>
39+
<div
40+
css={css`
41+
width: 100%;
42+
display: flex;
43+
color: ${DESIGN_SYSTEM_COLOR.kreamBlack};
44+
font-weight: 300;
45+
46+
#score {
47+
font-weight: 500;
48+
}
49+
50+
span:nth-of-type(1) {
51+
margin-right: auto;
52+
}
53+
54+
div:nth-of-type(1) {
55+
margin-left: auto;
56+
display: flex;
57+
column-gap: 0.8rem;
58+
}
59+
`}
60+
>
61+
<span id="score">
62+
{todoList.length && completeList.length ? Math.floor((completeList.length / (todoList.length + completeList.length)) * 100) : 0}%{" "}
63+
</span>
64+
<div>
65+
<span>
66+
완료된 아젠다 <span id="score">{completeList.length}</span>
67+
</span>
68+
<span>
69+
오픈된 아젠다 <span id="score">{todoList.length}</span>
70+
</span>
71+
</div>
72+
</div>
73+
</div>
74+
);
75+
}

0 commit comments

Comments
 (0)