Skip to content

Commit da12b5f

Browse files
committed
Passwordless Loader
1 parent 1f70e7f commit da12b5f

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

packages/modal/src/ui/components/Loader/Loader.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next";
44
import { MODAL_STATUS } from "../../interfaces";
55
import i18n from "../../localeImport";
66
import Image from "../Image";
7+
import PulseLoader from "../PulseLoader";
78
import { ConnectedStatusType, ConnectingStatusType, ErroredStatusType, LoaderProps } from "./Loader.type";
89

910
/**
@@ -27,11 +28,7 @@ function ConnectingStatus(props: ConnectingStatusType) {
2728
<img src={appLogo} alt="" className="w3a--size-full w3a--object-contain" />
2829
</figure>
2930

30-
<div className="w3a--flex w3a--items-center w3a--justify-center w3a--gap-x-2">
31-
<div className="w3a--animate-circle w3a--bg-app-gray-500 dark:w3a--bg-app-gray-200" />
32-
<div className="w3a--animate-circle w3a--bg-app-gray-400 dark:w3a--bg-app-gray-400" />
33-
<div className="w3a--animate-circle w3a--bg-app-gray-200 dark:w3a--bg-app-gray-600" />
34-
</div>
31+
<PulseLoader />
3532

3633
{providerIcon}
3734
</div>

packages/modal/src/ui/components/Login/LoginPasswordLess/LoginPasswordLess.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useTranslation } from "react-i18next";
33

44
import i18n from "../../../localeImport";
55
import { cn, getIcons } from "../../../utils";
6+
import PulseLoader from "../../PulseLoader";
67
import { LoginPasswordLessProps } from "./LoginPasswordLess.type";
78

89
function LoginPasswordLess(props: LoginPasswordLessProps) {
@@ -100,11 +101,9 @@ function LoginPasswordLess(props: LoginPasswordLessProps) {
100101
"w3a--w-full w3a--appearance-none w3a--bg-transparent w3a--text-app-gray-900 w3a--outline-none placeholder:w3a--text-xs placeholder:w3a--text-app-gray-400 focus:w3a--outline-none active:w3a--outline-none dark:w3a--text-app-white dark:placeholder:w3a--text-app-gray-500"
101102
)}
102103
onKeyDown={(e) => handleEnter(e)}
104+
disabled={isPasswordLessLoading}
103105
/>
104-
{isPasswordLessLoading && (
105-
// TODO: Add loading spinner
106-
<div>Loading..</div>
107-
)}
106+
{isPasswordLessLoading && <PulseLoader />}
108107
{inputValue && !isPasswordLessLoading && (
109108
<button type="button" className="w3a--icon-animation w3a--appearance-none" onClick={onFormSubmit}>
110109
<img src={getIcons(isDark ? "chevron-right-dark" : "chevron-right-light")} alt="arrow" />
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const PulseLoader = () => {
2+
return (
3+
<div className="w3a--flex w3a--items-center w3a--justify-center w3a--gap-x-2">
4+
<div className="w3a--animate-circle w3a--bg-app-gray-500 dark:w3a--bg-app-gray-200" />
5+
<div className="w3a--animate-circle w3a--bg-app-gray-400 dark:w3a--bg-app-gray-400" />
6+
<div className="w3a--animate-circle w3a--bg-app-gray-200 dark:w3a--bg-app-gray-600" />
7+
</div>
8+
);
9+
};
10+
11+
export default PulseLoader;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from "./PulseLoader";

0 commit comments

Comments
 (0)