Skip to content

Commit 15d87f4

Browse files
committed
chore(meister): 컴포넌트 리팩토링
1 parent 7bf68c3 commit 15d87f4

File tree

4 files changed

+111
-217
lines changed

4 files changed

+111
-217
lines changed

src/templates/meister/layouts/CircularProgressBox.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import { styled } from "styled-components";
33
import { getMeisterChapter } from "@/helpers";
44
import { CircularProgressbar, buildStyles } from "react-circular-progressbar";
55
import { color, flex, font } from "@/styles";
6-
import type { CircularProgressBoxProps } from "../interfaces";
7-
6+
import { CircularProgressBoxProps } from "../interfaces";
87
import "react-circular-progressbar/dist/styles.css";
98

109
const CircularProgressBox = ({

src/templates/meister/layouts/Distribution.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
11
import DistributionIcon from "@/assets/icons/DistributionIcon";
22
import { Row } from "@/components/Flex";
3-
import { IMeister } from "@/interfaces";
43
import { color, font } from "@/styles";
54
import flex from "@/styles/flex";
65
import React from "react";
76
import styled from "styled-components";
87
import RadarChart from "../chart/RadarChart";
8+
import { Meister } from "../interfaces";
99

1010
const spiderChartValue = [
1111
{ name: "내 점수", color: color.spider_first },
1212
{ name: "학년 평균", color: color.spider_second },
1313
];
1414

15-
interface IDistributionProps {
16-
meisterData: IMeister;
17-
}
18-
19-
const Distribution = ({ meisterData }: IDistributionProps) => {
15+
const Distribution = ({ ...meisterData }: Meister) => {
2016
return (
2117
<Container>
2218
<Row alignItems="center" gap="4px">
2319
<DistributionIcon />
2420
<TitleText>영역별 점수 분포도</TitleText>
2521
</Row>
2622
<RadarBox>
27-
<RadarChart meisterData={meisterData} />
23+
<RadarChart {...meisterData} />
2824
</RadarBox>
2925
<StatusBox>
3026
{spiderChartValue.map((chart) => (

src/templates/meister/layouts/YearlyMeisterScore.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,17 @@ import { color, font } from "@/styles";
44
import React from "react";
55
import styled from "styled-components";
66
import { getStatusColor } from "@/helpers";
7-
import { IMeister } from "@/interfaces";
87
import MeisterChart from "../chart/MeisterChart";
8+
import { Meister } from "../interfaces";
99

10-
interface IYearlyMeisterScroeProps {
11-
meisterData: IMeister;
12-
}
13-
14-
const YearlyMeisterScore = ({ meisterData }: IYearlyMeisterScroeProps) => {
10+
const YearlyMeisterScore = ({ ...meisterData }: Meister) => {
1511
return (
1612
<Container>
1713
<Row alignItems="center" gap="8px">
1814
<GraphIcon />
1915
<TitleText>연도별 점수 그래프</TitleText>
2016
</Row>
21-
<MeisterChart meisterData={meisterData} />
17+
<MeisterChart {...meisterData} />
2218
<StatusBox>
2319
{["학년 평균", "내 점수", "최고 점수"].map((year, index) => (
2420
<Row key={year} alignItems="center" gap="4px">

0 commit comments

Comments
 (0)