Skip to content

Commit

Permalink
feat: add loading state
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyguidomadrid committed Nov 10, 2024
1 parent 8871a34 commit a52b450
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FormEvent, useState } from "react";
import { useUserInfo } from "../../../../../hooks/useUserInfo";
import { TextField, Button, Alert } from "@mui/material";
import { TextField, Button, Alert, CircularProgress } from "@mui/material";

export const UserNameForm: React.FC = () => {
const {
Expand Down Expand Up @@ -40,8 +40,11 @@ export const UserNameForm: React.FC = () => {
color="primary"
role="submit"
disabled={isLoading}
startIcon={
isLoading ? <CircularProgress size={20} color="inherit" /> : null
}
>
Submit
{isLoading ? "Loading..." : "Submit"}
</Button>
</form>
);
Expand Down

0 comments on commit a52b450

Please sign in to comment.