Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove MUI circularProgress & grid #5047

Merged
merged 5 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/Components/Auth/Login.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useEffect, useState } from "react";
import { useDispatch } from "react-redux";
import { postForgotPassword, postLogin } from "../../Redux/actions";
import { Grid, CircularProgress } from "@material-ui/core";
import { useTranslation } from "react-i18next";
import ReCaptcha from "react-google-recaptcha";
import * as Notification from "../../Utils/Notifications.js";
Expand All @@ -11,6 +10,7 @@ import LanguageSelectorLogin from "../Common/LanguageSelectorLogin";
import CareIcon from "../../CAREUI/icons/CareIcon";
import useConfig from "../../Common/hooks/useConfig";
import { classNames } from "../../Utils/utils";
import CircularProgress from "../Common/components/CircularProgress";
import { LocalStorageKeys } from "../../Common/constants";

export const Login = (props: { forgot?: boolean }) => {
Expand Down Expand Up @@ -307,15 +307,15 @@ export const Login = (props: { forgot?: boolean }) => {
size="large"
className="font-extrabold"
/>
<Grid container justify="center">
<div className="grid justify-center ">
ayushjnv1 marked this conversation as resolved.
Show resolved Hide resolved
{isCaptchaEnabled && (
<Grid item className="px-8 py-4">
<div className="px-8 py-4 grid">
<ReCaptcha
sitekey={recaptcha_site_key}
onChange={onCaptchaChange}
/>
<span className="text-red-500">{errors.captcha}</span>
</Grid>
</div>
)}

<div className="w-full flex justify-between items-center py-4">
Expand All @@ -342,7 +342,7 @@ export const Login = (props: { forgot?: boolean }) => {
{t("login")}
</button>
)}
</Grid>
</div>
</div>
</form>
<LanguageSelectorLogin />
Expand Down Expand Up @@ -391,7 +391,7 @@ export const Login = (props: { forgot?: boolean }) => {
size="large"
className="font-extrabold"
/>
<Grid container justify="center">
<div className="grid justify-center">
ayushjnv1 marked this conversation as resolved.
Show resolved Hide resolved
{loading ? (
<div className="flex items-center justify-center">
<CircularProgress className="text-primary-500" />
Expand All @@ -404,7 +404,7 @@ export const Login = (props: { forgot?: boolean }) => {
{t("send_reset_link")}
</button>
)}
</Grid>
</div>
</div>
</form>
<LanguageSelectorLogin />
Expand Down
13 changes: 13 additions & 0 deletions src/Components/Common/components/CircularProgress.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
interface CircularProgressProps {
className?: string;
children?: JSX.Element | JSX.Element[];
}
export default function CircularProgress(props: CircularProgressProps) {
return (
<div
className={`text-primary-500 inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite] ${props?.className}`}
>
{props?.children}
</div>
);
}