Skip to content

Commit 70cd03d

Browse files
committed
react-native(TextButton.figma): remove nonexistent TextButtonSize and invalid props; map Figma size to TextVariant via variant; simplify example to text-only API
1 parent ffeb383 commit 70cd03d

1 file changed

Lines changed: 7 additions & 34 deletions

File tree

packages/design-system-react-native/src/components/TextButton/TextButton.figma.tsx

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
// import figma needs to remain as figma otherwise it breaks code connect
22
// eslint-disable-next-line import-x/no-named-as-default
33
import figma from '@figma/code-connect';
4+
import { TextVariant } from '@metamask/design-system-shared';
45
import React from 'react';
56

6-
import { IconName } from '../Icon';
7-
87
import { TextButton } from './TextButton';
98

10-
import { TextButtonSize } from '.';
11-
129
/**
1310
* -- This file was auto-generated by Code Connect --
1411
* React Native implementation of TextButton component
@@ -23,38 +20,14 @@ figma.connect(
2320
'https://www.figma.com/design/1D6tnzXqWgnUC3spaAOELN/%F0%9F%A6%8A-MMDS-Components?node-id=1%3A398',
2421
{
2522
props: {
26-
size: figma.enum('size', {
27-
BodyMd: TextButtonSize.BodyMd,
28-
BodySm: TextButtonSize.BodySm,
29-
}),
30-
isDisabled: figma.boolean('isDisabled'),
31-
isInverse: figma.boolean('isInverse'),
32-
startIconName: figma.boolean('startIcon (Figma Only)', {
33-
true: IconName.Add,
34-
false: undefined,
35-
}),
36-
endIconName: figma.boolean('endIcon (Figma Only)', {
37-
true: IconName.Add,
38-
false: undefined,
23+
// Map Figma "size" variant to Text variant used by RN TextButton
24+
variant: figma.enum('size', {
25+
BodyMd: TextVariant.BodyMd,
26+
BodySm: TextVariant.BodySm,
3927
}),
4028
},
41-
example: ({
42-
size,
43-
isDisabled,
44-
isInverse,
45-
startIconName,
46-
endIconName,
47-
...props
48-
}) => (
49-
<TextButton
50-
size={size}
51-
isDisabled={isDisabled}
52-
isInverse={isInverse}
53-
startIconName={startIconName}
54-
endIconName={endIconName}
55-
{...props}
56-
onPress={() => undefined}
57-
>
29+
example: ({ variant, ...props }) => (
30+
<TextButton variant={variant} {...props} onPress={() => undefined}>
5831
Text Button
5932
</TextButton>
6033
),

0 commit comments

Comments
 (0)