Skip to content

Commit bd260a9

Browse files
committed
fix: resolve conflict
2 parents a7b09d5 + c3ce861 commit bd260a9

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/components/primitives/Button/Button.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,16 @@ const Button = (
9696
);
9797
}
9898

99-
const boxChildren = isLoading && isLoadingText ? isLoadingText : children;
100-
10199
const spinnerElement = spinner ? (
102100
spinner
103101
) : (
104102
<Spinner color={_text?.color} {..._spinner} />
105103
);
106104

105+
const boxChildren = (child: any) => {
106+
return <Box _text={_text}>{child}</Box>;
107+
};
108+
107109
return (
108110
<Pressable
109111
disabled={isDisabled || isLoading}
@@ -127,14 +129,15 @@ const Button = (
127129
{...resolvedProps}
128130
accessibilityRole={props.accessibilityRole ?? 'button'}
129131
>
130-
<HStack {..._stack}>
132+
<HStack {..._stack} test={true}>
131133
{startIcon && !isLoading ? startIcon : null}
132134
{isLoading && spinnerPlacement === 'start' ? spinnerElement : null}
133-
{boxChildren ? (
134-
<Box _text={_text}>
135-
{isLoading && isLoadingText ? isLoadingText : children}
136-
</Box>
137-
) : null}
135+
{isLoading
136+
? isLoadingText
137+
? boxChildren(isLoadingText)
138+
: null
139+
: boxChildren(children)}
140+
138141
{endIcon && !isLoading ? endIcon : null}
139142
{isLoading && spinnerPlacement === 'end' ? spinnerElement : null}
140143
</HStack>

0 commit comments

Comments
 (0)