Skip to content

Commit 7b17b6f

Browse files
refactor: remove a secon duration badge added by merge actions
1 parent fac2af6 commit 7b17b6f

File tree

3 files changed

+8
-30
lines changed

3 files changed

+8
-30
lines changed

src/components/badges/Duration.tsx

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

6-
export const DurationBadge = ({ value, type = "gray" }: { value: number, type?: string }) => {
6+
interface DurationBadgeProps {
7+
value: number;
8+
type?: string;
9+
}
10+
11+
export const DurationBadge = ({ value, type = "gray" }: DurationBadgeProps) => {
712
const router = useRouter();
813
const duration = useMemo(() => {
914
if (!value) {
@@ -14,7 +19,7 @@ export const DurationBadge = ({ value, type = "gray" }: { value: number, type?:
1419
}, [router.locale, value]);
1520

1621
return (
17-
<span className={classNames("text-xxs uppercase font-semibold px-2 rounded-3xl inline-block text-gray-500",
22+
<span className={classNames("text-xxs uppercase font-semibold px-2 rounded-3xl inline-block text-gray-500 text-nowrap",
1823
{
1924
"bg-gray-200": type === 'gray',
2025
"border border-gray-200": type === "bordered"

src/components/badges/DurationBadge.tsx

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/components/cards/course/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import ArrowButton from "@/components/ui/button/Arrow";
22
import { useSelector } from "react-redux";
33
import { IRootState } from "@/store"; import Link from "next/link";
44
import Badges from "@/components/badges";
5-
import DurationBadge from "@/components/badges/DurationBadge";
5+
import { DurationBadge } from "@/components/badges/Duration";
66
import { useTranslation } from "next-i18next";
77

88

0 commit comments

Comments
 (0)