Skip to content

Commit 464249c

Browse files
refactor: use durationbadge instead of durationCard
1 parent 7cd14fa commit 464249c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/components/badges/Duration.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import classNames from "classnames";
33
import { useRouter } from "next/router";
44
import { useMemo } from "react";
55

6-
export const DurationCard = ({ value, type = "gray" }: { value: number, type?: string }) => {
6+
export const DurationBadge = ({ value, type = "gray" }: { value: number, type?: string }) => {
77
const router = useRouter();
88
const duration = useMemo(() => {
99
if (!value) {

src/components/cards/Learning.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import useNavigation from "@/hooks/useNavigation";
22
import { useRouter } from "next/router";
33
import { ReactElement } from "react";
4-
import { DurationCard } from "../badges/Duration";
4+
import { DurationBadge } from "../badges/Duration";
55

66
/**
77
* LearningModule interface
@@ -50,7 +50,7 @@ export default function Learning({ learningModule }: LearningProps): ReactElemen
5050
<div onClick={navigate} className="flex flex-col">
5151
<div className="w-full">
5252
<h4 className="font-medium block text-xl mb-4">{learningModule.title}</h4>
53-
{learningModule.duration && <DurationCard type="bordered" value={learningModule.duration} />}
53+
{learningModule.duration && <DurationBadge type="bordered" value={learningModule.duration} />}
5454
</div>
5555
{learningModule.description && (
5656
<span className="text-sm mt-4 rounded-3xl">

src/components/cards/LearningModule.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import ArrowButton from "@/components/ui/button/Arrow";
33
import Link from "next/link";
44
import { useTranslation } from "next-i18next";
55
import Tag from "../ui/Tag";
6-
import { DurationCard } from "@/components/badges/Duration";
6+
import { DurationBadge } from "@/components/badges/Duration";
77
import { useMultiSelector } from "@/hooks/useTypedSelector";
88
import { IRootState } from "@/store";
99
import { LearningModule } from "@/types/course";
@@ -39,7 +39,7 @@ export function LearningModuleCard({ data }: { data: LearningModule }): JSX.Elem
3939
</div>
4040
<div className="gap-2 flex items-center">
4141
{challenge.level && <Tag className="uppercase">{level}</Tag>}
42-
<DurationCard value={data.duration} type="bordered" />
42+
<DurationBadge value={data.duration} type="bordered" />
4343
</div>
4444
</div>
4545

0 commit comments

Comments
 (0)