From 5858ac6976dc4a5b179abfc265aec80f74d170d9 Mon Sep 17 00:00:00 2001 From: Fredrik Thorsson Date: Tue, 15 Oct 2024 09:33:23 +0200 Subject: [PATCH] feat(SW-439): use existing type --- components/Blocks/CardsGrid.tsx | 9 ++++----- components/TempDesignSystem/Grids/Stackable/stackable.ts | 4 +--- types/components/blocks/cardsGrid.ts | 2 -- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/components/Blocks/CardsGrid.tsx b/components/Blocks/CardsGrid.tsx index 2158fad35..89396b8b1 100644 --- a/components/Blocks/CardsGrid.tsx +++ b/components/Blocks/CardsGrid.tsx @@ -5,17 +5,16 @@ import Grids from "@/components/TempDesignSystem/Grids" import LoyaltyCard from "@/components/TempDesignSystem/LoyaltyCard" import TeaserCard from "@/components/TempDesignSystem/TeaserCard" -import type { - CardsGridProps, - Columns, -} from "@/types/components/blocks/cardsGrid" +import { StackableGridProps } from "../TempDesignSystem/Grids/Stackable/stackable" + +import type { CardsGridProps } from "@/types/components/blocks/cardsGrid" import { CardsGridEnum, CardsGridLayoutEnum } from "@/types/enums/cardsGrid" export default function CardsGrid({ cards_grid, firstItem = false, }: CardsGridProps) { - let columns: Columns + let columns: StackableGridProps["columns"] switch (cards_grid.layout) { case CardsGridLayoutEnum.ONE_COLUMN: diff --git a/components/TempDesignSystem/Grids/Stackable/stackable.ts b/components/TempDesignSystem/Grids/Stackable/stackable.ts index 9e58bbdb8..65dd90fed 100644 --- a/components/TempDesignSystem/Grids/Stackable/stackable.ts +++ b/components/TempDesignSystem/Grids/Stackable/stackable.ts @@ -2,10 +2,8 @@ import { stackableGridVariants } from "./variants" import type { VariantProps } from "class-variance-authority" -import { Columns } from "@/types/components/blocks/cardsGrid" - export interface StackableGridProps extends React.HTMLAttributes, VariantProps { - columns?: Columns + columns?: 1 | 2 | 3 } diff --git a/types/components/blocks/cardsGrid.ts b/types/components/blocks/cardsGrid.ts index 4115cb6e8..5b1566b27 100644 --- a/types/components/blocks/cardsGrid.ts +++ b/types/components/blocks/cardsGrid.ts @@ -3,5 +3,3 @@ import { CardsGrid } from "@/types/trpc/routers/contentstack/blocks" export interface CardsGridProps extends Pick { firstItem?: boolean } - -export type Columns = 1 | 2 | 3