From 8dd13002963b00240dc34363669ea8c9882dcb68 Mon Sep 17 00:00:00 2001 From: Mcklien Ross Onoya <76947297+mcklien@users.noreply.github.com> Date: Fri, 28 Jul 2023 12:38:38 +0200 Subject: [PATCH 1/2] prop to resize skeleton height for text --- packages/spor-react/src/loader/SkeletonText.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/spor-react/src/loader/SkeletonText.tsx b/packages/spor-react/src/loader/SkeletonText.tsx index 79a4a3ff1..51291413e 100644 --- a/packages/spor-react/src/loader/SkeletonText.tsx +++ b/packages/spor-react/src/loader/SkeletonText.tsx @@ -1,7 +1,10 @@ -import { BoxProps, SkeletonText as ChakraSkeletonText } from "@chakra-ui/react"; +import { BoxProps, SkeletonText as ChakraSkeletonText, SkeletonProps } from "@chakra-ui/react"; import React from "react"; -export type SkeletonTextProps = BoxProps; +export type SkeletonTextProps = BoxProps & { + skeletonHeight?: SkeletonProps["height"] +}; + /** * SkeletonText renders a loading animation for a given text. It works great as a placeholder to avoid layout shifts. */ From 8785dc438d176a4ee11c1fc4cbe799e81d922e5d Mon Sep 17 00:00:00 2001 From: Mcklien Ross Onoya <76947297+mcklien@users.noreply.github.com> Date: Mon, 7 Aug 2023 09:21:28 +0200 Subject: [PATCH 2/2] eksportere typen til Chakra direkte --- packages/spor-react/src/loader/SkeletonText.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/spor-react/src/loader/SkeletonText.tsx b/packages/spor-react/src/loader/SkeletonText.tsx index 51291413e..51e271d75 100644 --- a/packages/spor-react/src/loader/SkeletonText.tsx +++ b/packages/spor-react/src/loader/SkeletonText.tsx @@ -1,9 +1,7 @@ -import { BoxProps, SkeletonText as ChakraSkeletonText, SkeletonProps } from "@chakra-ui/react"; +import { SkeletonText as ChakraSkeletonText, SkeletonTextProps as ChakraSkeletonTextProps } from "@chakra-ui/react"; import React from "react"; -export type SkeletonTextProps = BoxProps & { - skeletonHeight?: SkeletonProps["height"] -}; +export type SkeletonTextProps = ChakraSkeletonTextProps /** * SkeletonText renders a loading animation for a given text. It works great as a placeholder to avoid layout shifts.