Skip to content

Commit

Permalink
Merge pull request #303 from boostcampwm-2022/develop
Browse files Browse the repository at this point in the history
v0.2.1
  • Loading branch information
tunggary authored Dec 13, 2022
2 parents 233f2df + d0ec9b6 commit 53ab800
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions frontend/src/components/Profile/Statistic/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import dynamic from 'next/dynamic';
import styled, { useTheme } from 'styled-components';
import { RANK } from '@type/common';
import { ProfileUserResponse } from '@type/response';
import { HistoryType, RANK, ScoreHistory } from '@type/common';
import { Tooltip } from '@components/Chart';
import { TIER_OFFSET } from '@utils/constants';
import {
Expand All @@ -15,14 +14,16 @@ const PieChart = dynamic(() => import('@components/Chart/PieChart'), { ssr: fals
const LineChart = dynamic(() => import('@components/Chart/LineChart'), { ssr: false });

interface ContributionStatisticProps {
data: ProfileUserResponse;
history: HistoryType;
scoreHistory: ScoreHistory[];
tier: RANK;
}

function Statistic({ data }: ContributionStatisticProps) {
function Statistic({ history, scoreHistory, tier }: ContributionStatisticProps) {
const theme = useTheme();
const pieChartData = transToPieChartData(data.history);
const contributionHistoryData = transContributionHistoryToLineChartData(data.history.contributionHistory, data.tier);
const scoreHistoryData = transScoreHistoryToLineChartData(data.scoreHistory, data.tier);
const pieChartData = transToPieChartData(history);
const contributionHistoryData = transContributionHistoryToLineChartData(history.contributionHistory, tier);
const scoreHistoryData = transScoreHistoryToLineChartData(scoreHistory, tier);
const { min, max } = getLineChartMinMaxValue(scoreHistoryData);

return (
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/profile/[username].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function Profile({ username }: ProfileProps) {
</Paper>
<Title>Stats</Title>
<Paper>
<Statistic data={data} />
<Statistic history={data.history} scoreHistory={data.scoreHistory} tier={data.tier} />
</Paper>
<Title>Pinned Repositories</Title>
<Paper>
Expand Down

0 comments on commit 53ab800

Please sign in to comment.