From e9b4946c73642803c94fbfce2ed768c8ca02791b Mon Sep 17 00:00:00 2001 From: RadoslavDimchev Date: Fri, 11 Aug 2023 10:17:27 +0300 Subject: [PATCH] fix: update formatted text to work with status --- src/components/FormattedText.tsx | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/src/components/FormattedText.tsx b/src/components/FormattedText.tsx index a0d02652..671e0e0d 100644 --- a/src/components/FormattedText.tsx +++ b/src/components/FormattedText.tsx @@ -1,35 +1,27 @@ -import { Text } from 'tamagui' +import { Text } from '@status-im/components' export type TextElement = { text: string bold?: boolean italic?: boolean + weight?: 'regular' | 'medium' | 'bold' } type FormattedTextProps = { textElements: TextElement[] color?: string - fontSize?: string + size: 27 | 19 | 15 | 13 | 11 } -const FormattedText = ({ textElements, color, fontSize }: FormattedTextProps) => { - const calculateStyle = (textElement: TextElement) => { - const isBold = textElement.bold ?? false - const isItalic = textElement.italic ?? false - - return { fontWeight: isBold ? 'bold' : '', fontStyle: isItalic ? 'italic' : '' } - } - +const FormattedText = ({ textElements, color, size }: FormattedTextProps) => { return ( - - {textElements.map((textElement, index) => { - return ( - - {textElement.text} - - ) - })} - + <> + {textElements.map((textElement, index) => ( + + {textElement.text} + + ))} + ) }