Skip to content

Commit 00693bf

Browse files
committed
feat: auth page
1 parent 687de3e commit 00693bf

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

frontend/src/components/AuthPage/SignIn/BasicSignIn/BasicSignIn.styled.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
import styled from 'styled-components';
22

3-
export const Form = styled.form`
3+
export const Fieldset = styled.fieldset`
44
display: flex;
55
flex-direction: column;
66
align-items: center;
77
justify-content: center;
8-
gap: 40px;
8+
gap: 16px;
9+
border: none;
910
width: 100%;
10-
11-
div {
12-
width: 100%;
13-
}
1411
`;
1512

16-
export const Fieldset = styled.fieldset`
13+
export const Form = styled.form`
1714
display: flex;
1815
flex-direction: column;
1916
align-items: center;
2017
justify-content: center;
21-
gap: 16px;
22-
border: none;
18+
gap: 40px;
2319
width: 100%;
20+
21+
${Fieldset} div {
22+
width: 100%;
23+
}
2424
`;
2525

2626
export const Field = styled.div`

frontend/src/components/AuthPage/SignIn/BasicSignIn/BasicSignIn.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function BasicSignIn() {
1919
defaultValues: { username: '', password: '' },
2020
});
2121
const navigate = useNavigate();
22-
const { mutateAsync } = useAuthenticate();
22+
const { mutateAsync, isLoading } = useAuthenticate();
2323
const client = useQueryClient();
2424

2525
const onSubmit = async (data: FormValues) => {
@@ -89,6 +89,7 @@ function BasicSignIn() {
8989
type="submit"
9090
style={{ width: '100%', borderRadius: '8px' }}
9191
disabled={!methods.formState.isValid}
92+
inProgress={isLoading}
9293
>
9394
Log in
9495
</Button>

frontend/src/components/AuthPage/SignIn/OAuthSignIn/AuthCard/AuthCard.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { ElementType } from 'react';
1+
import React, { ElementType, useState } from 'react';
22
import ServiceImage from 'components/common/Icons/ServiceImage';
33

44
import * as S from './AuthCard.styled';
@@ -10,6 +10,8 @@ interface Props {
1010
}
1111

1212
function AuthCard({ serviceName, authPath, Icon = ServiceImage }: Props) {
13+
const [isLoading, setIsLoading] = useState(false);
14+
1315
return (
1416
<S.AuthCardStyled>
1517
<S.ServiceData>
@@ -24,7 +26,11 @@ function AuthCard({ serviceName, authPath, Icon = ServiceImage }: Props) {
2426
<S.ServiceButton
2527
buttonSize="L"
2628
buttonType="primary"
27-
onClick={() => window.location.replace(`${window.basePath}${authPath}`)}
29+
onClick={() => {
30+
setIsLoading(true);
31+
window.location.replace(`${window.basePath}${authPath}`);
32+
}}
33+
inProgress={isLoading}
2834
>
2935
Log in with {serviceName}
3036
</S.ServiceButton>

0 commit comments

Comments
 (0)