From 3a7f10a205e2419072f6a146a8756516e6518e48 Mon Sep 17 00:00:00 2001 From: Vass Bence <49574140+vassbence@users.noreply.github.com> Date: Wed, 24 Jul 2024 16:49:13 +0200 Subject: [PATCH] use reactnode instead of string as children --- src/components/Button/index.tsx | 4 ++-- src/components/Text/index.tsx | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/Button/index.tsx b/src/components/Button/index.tsx index eb7f83d..5a68476 100644 --- a/src/components/Button/index.tsx +++ b/src/components/Button/index.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react' +import { ReactNode, useState } from 'react' import { radius } from '../../utils/radius.js' import { Icon, IconProps } from '../Icon/index.js' import { Text } from '../Text/index.js' @@ -8,7 +8,7 @@ import { KeyHint, KeyHintProps } from '../KeyHint/index.js' import { styled } from 'inlines' type ButtonProps = { - children: string + children: ReactNode onClick: () => void | Promise disabled?: boolean variant?: 'primary' | 'secondary' | 'ghost' diff --git a/src/components/Text/index.tsx b/src/components/Text/index.tsx index 81b38dc..b46bb3d 100644 --- a/src/components/Text/index.tsx +++ b/src/components/Text/index.tsx @@ -1,7 +1,8 @@ +import { ReactNode } from 'react' import { Color, colors } from '../../utils/colors.js' type TextProps = { - children: string + children: ReactNode variant?: | 'display-regular' | 'display-medium'