Skip to content

Commit

Permalink
Add loading to sign up page
Browse files Browse the repository at this point in the history
  • Loading branch information
shahanneda committed Sep 2, 2024
1 parent ccbf874 commit c8a044f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions frontend/src/components/auth/Join.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
Link,
Radio,
RadioGroup,
Spinner,
Stack,
Text,
Textarea,
Expand Down Expand Up @@ -113,7 +114,7 @@ const Join = (): React.ReactElement => {

const [attemptedSubmit, setAttemptedSubmit] = useState(false);
const isWebView = useIsWebView();
const [signup] = useMutation<{ createOnboardingRequest: OnboardingRequest }>(
const [signup, {loading : signUpLoading}] = useMutation<{ createOnboardingRequest: OnboardingRequest }>(
SIGNUP,
);
const toast = useToast();
Expand Down Expand Up @@ -589,7 +590,7 @@ const Join = (): React.ReactElement => {
variant={{ base: "mobile-button-bold", lg: "desktop-button-bold" }}
color="white"
bgColor="primary.blue"
disabled={attemptedSubmit && !isRequestValid()}
disabled={(attemptedSubmit && !isRequestValid()) || signUpLoading}
_hover={{ bgColor: "primary.blue" }}
_disabled={{
bgColor: "#CCCCCC !important",
Expand All @@ -599,7 +600,7 @@ const Join = (): React.ReactElement => {
borderRadius="6px"
onClick={handleSubmit}
>
Create Account
{signUpLoading ? <Spinner /> : "Create Account"}
</Button>
<Text
color="text.subtitle"
Expand Down

0 comments on commit c8a044f

Please sign in to comment.