Enforce that text is wrapped in <Text>, remaining cases (#3421)

* Toggle.Button -> Toggle.ButtonWithText

* Simplify Prompt.Cancel/Action

* Move lines down for better diff

* Remove ButtonWithText

* Simplify types

* Enforce Button/ButtonText nesting

* Add suggested wrapper in linter error

* Check <Trans> ancestry too

* Also check literals

* Rm ts-ignore
This commit is contained in:
dan
2024-04-05 15:09:35 +01:00
committed by GitHub
parent 49266c355e
commit 46c112edfd
15 changed files with 589 additions and 75 deletions
+8 -8
View File
@@ -4,15 +4,15 @@ import {View} from 'react-native'
import {atoms as a} from '#/alf'
import {
Button,
ButtonVariant,
ButtonColor,
ButtonIcon,
ButtonText,
ButtonVariant,
} from '#/components/Button'
import {H1} from '#/components/Typography'
import {ArrowTopRight_Stroke2_Corner0_Rounded as ArrowTopRight} from '#/components/icons/ArrowTopRight'
import {ChevronLeft_Stroke2_Corner0_Rounded as ChevronLeft} from '#/components/icons/Chevron'
import {Globe_Stroke2_Corner0_Rounded as Globe} from '#/components/icons/Globe'
import {H1} from '#/components/Typography'
export function Buttons() {
return (
@@ -29,7 +29,7 @@ export function Buttons() {
color={color as ButtonColor}
size="large"
label="Click here">
Button
<ButtonText>Button</ButtonText>
</Button>
<Button
disabled
@@ -37,7 +37,7 @@ export function Buttons() {
color={color as ButtonColor}
size="large"
label="Click here">
Button
<ButtonText>Button</ButtonText>
</Button>
</React.Fragment>
))}
@@ -54,7 +54,7 @@ export function Buttons() {
color={name as ButtonColor}
size="large"
label="Click here">
Button
<ButtonText>Button</ButtonText>
</Button>
<Button
disabled
@@ -62,7 +62,7 @@ export function Buttons() {
color={name as ButtonColor}
size="large"
label="Click here">
Button
<ButtonText>Button</ButtonText>
</Button>
</React.Fragment>
),
@@ -77,7 +77,7 @@ export function Buttons() {
color={name as ButtonColor}
size="large"
label="Click here">
Button
<ButtonText>Button</ButtonText>
</Button>
<Button
disabled
@@ -85,7 +85,7 @@ export function Buttons() {
color={name as ButtonColor}
size="large"
label="Click here">
Button
<ButtonText>Button</ButtonText>
</Button>
</React.Fragment>
),