Skip to content

Commit

Permalink
Fix loading prop receiving a non-boolean value
Browse files Browse the repository at this point in the history
  • Loading branch information
silentworks committed Oct 28, 2022
1 parent 3434dbb commit 8dd8fba
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilly-jars-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@supabase/auth-ui-react': patch
---

Fix warning about the loading receiving a non-boolean attribute
7 changes: 6 additions & 1 deletion packages/react/src/components/Auth/interfaces/EmailAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@ function EmailAuth({
</div>
</Container>

<Button type="submit" color="primary" appearance={appearance}>
<Button
type="submit"
color="primary"
loading={loading}
appearance={appearance}
>
{i18n?.[authView]?.button_label}
</Button>

Expand Down
5 changes: 4 additions & 1 deletion packages/react/src/components/UI/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ const Button: React.FC<ButtonProps> = ({
children,
color = 'default',
appearance,
icon,
loading = false,
...props
}) => {
const classNames = generateClassNames(
Expand All @@ -67,8 +69,9 @@ const Button: React.FC<ButtonProps> = ({
{...props}
style={appearance?.style?.button}
className={classNames.join(' ')}
disabled={loading}
>
{props.icon}
{icon}
{children}
</button>
)
Expand Down

0 comments on commit 8dd8fba

Please sign in to comment.