Skip to content

Commit

Permalink
Feature/fix chakra progress theme error (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
SeungJL authored May 19, 2024
2 parents dba3882 + 783fa83 commit 5e87ede
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 17 deletions.
15 changes: 15 additions & 0 deletions components/atoms/ProgressBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Progress } from "@chakra-ui/react";

interface IProgressBar {
value: number;
colorScheme?: "mintTheme";
hasStripe?: boolean;
}

export default function ProgressBar({
value,
colorScheme = "mintTheme",
hasStripe = false,
}: IProgressBar) {
return <Progress value={value} colorScheme={colorScheme} hasStripe={hasStripe} />;
}
4 changes: 2 additions & 2 deletions components/molecules/ProgressStatus.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Progress } from "@chakra-ui/react";
import styled from "styled-components";
import ProgressBar from "../atoms/ProgressBar";

interface IProgressStatus {
value: number;
Expand All @@ -8,7 +8,7 @@ interface IProgressStatus {
function ProgressStatus({ value }: IProgressStatus) {
return (
<Layout>
<Progress value={value} size="sm" />
<ProgressBar value={value} />
</Layout>
);
}
Expand Down
8 changes: 4 additions & 4 deletions pageTemplates/point/pointScore/PointScoreBar.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Badge, Progress } from "@chakra-ui/react";
import { Badge } from "@chakra-ui/react";
import { faQuestionCircle } from "@fortawesome/pro-light-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useSession } from "next-auth/react";
import { useEffect, useState } from "react";
import styled from "styled-components";
import ProgressBar from "../../../components/atoms/ProgressBar";

import {
BADGE_COLOR_MAPPINGS,
Expand Down Expand Up @@ -80,11 +81,10 @@ function PointScoreBar({ myScore, hasQuestion = true }: IPointScoreBar) {
</div>
)}
</Grade>
<Progress
<ProgressBar
value={(1 - (nextBadgePoint - myScore) / badgeGap) * 100}
height="12px"
colorScheme="mintTheme"
hasStripe
hasStripe={true}
/>
</Layout>

Expand Down
2 changes: 1 addition & 1 deletion pages/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useAdminStudyRecordQuery } from "../hooks/admin/quries";
import { useImageUploadMutation } from "../hooks/image/mutations";
import { studyDateStatusState } from "../recoils/studyRecoils";
function Test() {
const { data } = useAdminStudyRecordQuery(dayjs("2024-04-01"), dayjs("2024-04-07"), null, "인천");
const { data } = useAdminStudyRecordQuery(dayjs("2024-04-16"), dayjs("2024-04-30"), null, "인천");
console.log(data);

const a = useRecoilValue(studyDateStatusState);
Expand Down
10 changes: 0 additions & 10 deletions theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,6 @@ const theme = extendTheme({
},
},
},
Progress: {
baseStyle: {
track: {
bg: "var(--font-h7)",
},
filledTrack: {
bg: "var(--color-mint)",
},
},
},
},
});

Expand Down

0 comments on commit 5e87ede

Please sign in to comment.