Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save anthowen/c87030fc2981a54b4820e2a2dce4648b to your computer and use it in GitHub Desktop.
Save anthowen/c87030fc2981a54b4820e2a2dce4648b to your computer and use it in GitHub Desktop.
<LoadingButton
ariaErrorAlert={"There was an error creating your account"}
ariaLoadingAlert={
authState === AuthState.CreatingUser
? "Registering account, please wait..."
: authState === AuthState.FulfillingPurchase
? "Generating license, please wait..."
: "Loading..."
}
ariaSuccessAlert="Account created! Redirecting."
ariaText="Create Account"
disabled={!formIsValid}
icon={<IconLock className="h-5 w-5 text-blue-700" />}
iconError={<IconError className="h-5 w-5" />}
iconLoading={<BeatSpinner />}
iconSuccess={<IconCheck className="h-5 w-5" />}
state={
authState === AuthState.CreatingUser ||
authState === AuthState.FulfillingPurchase
? "loading"
: authState === AuthState.Error
? "error"
: authState === AuthState.Success
? "success"
: "idle"
}
text="Create Account"
textLoading={
authState === AuthState.CreatingUser
? "Registering..."
: authState === AuthState.FulfillingPurchase
? "Generating license..."
: "Loading..."
}
type="submit"
className={`w-full py-2 px-4 border-2 border-transparent text-sm font-medium rounded-md text-white bg-blue-500 hover:bg-blue-600 focus:outline-none focus:border-yellow-500 ${
formIsValid ? "" : "opacity-50"
}`}
/>
@anthowen
Copy link
Author

anthowen commented Mar 4, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment