From 8f4b517b8585ca64a4bf44f6cb40ac070ece8932 Mon Sep 17 00:00:00 2001 From: Hailey Date: Mon, 22 Jan 2024 13:09:45 -0800 Subject: [PATCH] add `style` to toggle label to modify text style --- src/components/forms/Toggle.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/forms/Toggle.tsx b/src/components/forms/Toggle.tsx index fe919132c7..2b804e7729 100644 --- a/src/components/forms/Toggle.tsx +++ b/src/components/forms/Toggle.tsx @@ -1,5 +1,5 @@ import React from 'react' -import {Pressable, View, ViewStyle} from 'react-native' +import {Pressable, TextStyle, View, ViewStyle} from 'react-native' import {HITSLOP_10} from 'lib/constants' import {useTheme, atoms as a, web, native} from '#/alf' @@ -233,7 +233,10 @@ export function Item({ ) } -export function Label({children}: React.PropsWithChildren<{}>) { +export function Label({ + children, + style = [], +}: React.PropsWithChildren<{style?: TextStyle[]}>) { const t = useTheme() const {disabled} = useItemContext() return ( @@ -247,6 +250,7 @@ export function Label({children}: React.PropsWithChildren<{}>) { native({ paddingTop: 3, }), + ...style, ]}> {children}