From bbbaeedd3ebbdae82cea6cc7f8c6ec37683f2175 Mon Sep 17 00:00:00 2001 From: Bianca Date: Thu, 9 Apr 2026 15:39:36 +0200 Subject: [PATCH 1/2] feat: add CardSplit component to enhance layout options --- src/app/page.tsx | 4 ++++ src/components/card-split.tsx | 37 +++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/components/card-split.tsx diff --git a/src/app/page.tsx b/src/app/page.tsx index 62c7213..93a53ef 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,5 +1,6 @@ import { FiBook, FiBookOpen, FiClipboard, FiFileText, FiPenTool, FiTriangle, FiUploadCloud } from "react-icons/fi" import { CardIcon } from "@/components/card-icon" +import { CardSplit } from "@/components/card-split" import { Hero } from "@/components/home/hero" const schoolCards = [ @@ -35,6 +36,9 @@ export default function Home() { return (
+
+ +
diff --git a/src/components/card-split.tsx b/src/components/card-split.tsx new file mode 100644 index 0000000..51a9a1f --- /dev/null +++ b/src/components/card-split.tsx @@ -0,0 +1,37 @@ +import { Glass } from "@/components/glass" +import { cn } from "@/lib/utils" + +type CardSplitProps = { + textLeft?: string + textRight?: string + textSmall?: string + className?: string +} + +export function CardSplit({ textLeft, textRight, textSmall, className }: CardSplitProps) { + const hasRightContent = Boolean(textRight || textSmall) + + return ( + +
+ {textLeft && ( +

+ {textLeft} +

+ )} + + {hasRightContent && ( +
+ {textRight &&

{textRight}

} + {textSmall &&

{textSmall}

} +
+ )} +
+
+ ) +} From c7620c0844858097a578b589cc1aa6a156e2134e Mon Sep 17 00:00:00 2001 From: Bianca Date: Thu, 9 Apr 2026 15:48:08 +0200 Subject: [PATCH 2/2] feat: refactor CardSplit component to use new props structure and separate content components --- src/app/page.tsx | 2 +- src/components/card-split.tsx | 37 ------------------- src/components/card-split/index.tsx | 31 ++++++++++++++++ src/components/card-split/primary-content.tsx | 7 ++++ .../card-split/secondary-content.tsx | 20 ++++++++++ src/components/card-split/types.ts | 6 +++ 6 files changed, 65 insertions(+), 38 deletions(-) delete mode 100644 src/components/card-split.tsx create mode 100644 src/components/card-split/index.tsx create mode 100644 src/components/card-split/primary-content.tsx create mode 100644 src/components/card-split/secondary-content.tsx create mode 100644 src/components/card-split/types.ts diff --git a/src/app/page.tsx b/src/app/page.tsx index 93a53ef..1837485 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -37,7 +37,7 @@ export default function Home() {
- +
diff --git a/src/components/card-split.tsx b/src/components/card-split.tsx deleted file mode 100644 index 51a9a1f..0000000 --- a/src/components/card-split.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { Glass } from "@/components/glass" -import { cn } from "@/lib/utils" - -type CardSplitProps = { - textLeft?: string - textRight?: string - textSmall?: string - className?: string -} - -export function CardSplit({ textLeft, textRight, textSmall, className }: CardSplitProps) { - const hasRightContent = Boolean(textRight || textSmall) - - return ( - -
- {textLeft && ( -

- {textLeft} -

- )} - - {hasRightContent && ( -
- {textRight &&

{textRight}

} - {textSmall &&

{textSmall}

} -
- )} -
-
- ) -} diff --git a/src/components/card-split/index.tsx b/src/components/card-split/index.tsx new file mode 100644 index 0000000..a5c3831 --- /dev/null +++ b/src/components/card-split/index.tsx @@ -0,0 +1,31 @@ +import { Glass } from "@/components/glass" +import { cn } from "@/lib/utils" +import { CardSplitPrimaryContent } from "./primary-content" +import { CardSplitSecondaryContent } from "./secondary-content" +import type { CardSplitProps } from "./types" + +export function CardSplit({ textPrimary, textSecondary, textSecondarySmall, className }: CardSplitProps) { + const hasPrimaryContent = Boolean(textPrimary) + const hasSecondaryContent = Boolean(textSecondary || textSecondarySmall) + + return ( + +
+ {textPrimary ? : null} + + {hasSecondaryContent && ( + + )} +
+
+ ) +} diff --git a/src/components/card-split/primary-content.tsx b/src/components/card-split/primary-content.tsx new file mode 100644 index 0000000..22079f6 --- /dev/null +++ b/src/components/card-split/primary-content.tsx @@ -0,0 +1,7 @@ +export function CardSplitPrimaryContent({ text }: { text: string }) { + return ( +

+ {text} +

+ ) +} diff --git a/src/components/card-split/secondary-content.tsx b/src/components/card-split/secondary-content.tsx new file mode 100644 index 0000000..f1b44a4 --- /dev/null +++ b/src/components/card-split/secondary-content.tsx @@ -0,0 +1,20 @@ +import { cn } from "@/lib/utils" + +type CardSplitSecondaryContentProps = { + textSecondary?: string + textSecondarySmall?: string + hasPrimaryContent: boolean +} + +export function CardSplitSecondaryContent({ + textSecondary, + textSecondarySmall, + hasPrimaryContent, +}: CardSplitSecondaryContentProps) { + return ( +
+ {textSecondary &&

{textSecondary}

} + {textSecondarySmall &&

{textSecondarySmall}

} +
+ ) +} diff --git a/src/components/card-split/types.ts b/src/components/card-split/types.ts new file mode 100644 index 0000000..1ad4557 --- /dev/null +++ b/src/components/card-split/types.ts @@ -0,0 +1,6 @@ +export type CardSplitProps = { + textPrimary?: string + textSecondary?: string + textSecondarySmall?: string + className?: string +}