Skip to content

Commit df685a9

Browse files
committed
added stories for ui kit, change auth forms
1 parent 63b2263 commit df685a9

File tree

38 files changed

+309
-147
lines changed

38 files changed

+309
-147
lines changed

client/configs/storybook/preview.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { withThemeByClassName } from '@storybook/addon-themes';
1+
import { withThemeByDataAttribute } from '@storybook/addon-themes';
22
import type { Preview } from '@storybook/react-vite';
33
import { setupWorker } from 'msw/browser';
44

@@ -28,12 +28,11 @@ const preview: Preview = {
2828
decorators: [
2929
StyleDecorator,
3030
RouterDecorator,
31-
withThemeByClassName({
32-
themes: {
33-
twitter: 'theme-twt',
34-
facebook: 'theme-fb',
35-
},
36-
defaultTheme: 'twitter',
31+
withThemeByDataAttribute({
32+
themes: { light: 'light', dark: 'dark' },
33+
defaultTheme: 'dark',
34+
attributeName: 'data-theme',
35+
parentSelector: 'body',
3736
}),
3837
],
3938
};
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.layout {
22
display: grid;
3-
grid-template-columns: 280px auto;
4-
gap: 20px;
5-
margin: 20px;
63

74
height: var(--layout-height);
5+
margin: 20px;
6+
gap: 20px;
7+
grid-template-columns: 280px auto;
88
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.layout {
22

3-
margin: 20px;
4-
53
height: var(--layout-height);
4+
5+
margin: 20px;
66
}

client/src/app/styles/index.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
@use "./scss/reset.scss";
2-
@use "./scss/vars.scss";
3-
@use "./scss/base.scss";
1+
@use "./scss/reset";
2+
@use "./scss/vars";
3+
@use "./scss/fonts";
4+
@use "./scss/base";

client/src/app/styles/scss/base.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
}
66

77
body {
8+
overflow: hidden;
89
width: 100%;
910
height: 100vh;
10-
color: var(--color-text);
1111
background: conic-gradient(
1212
from 330deg at 50% 50%,
1313
var(--grad-1) 0deg,
@@ -16,10 +16,10 @@ body {
1616
var(--grad-4) 270deg,
1717
var(--grad-1) 360deg
1818
);
19+
background-blend-mode: screen;
1920

2021
background-size: 100% 100%;
21-
background-blend-mode: screen;
22-
overflow: hidden;
22+
color: var(--color-text);
2323

2424
font: var(--font-m);
2525
}
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
@font-face {
2-
font-family: "Manrope-Custom";
3-
src: url("/fonts/Manrope-Medium.ttf") format("truetype");
4-
font-weight: 500;
2+
font-family: Manrope-Custom;
53
font-style: normal;
4+
font-weight: 500;
5+
src: url("/fonts/Manrope-Medium.ttf") format("truetype");
66
}
77

88
@font-face {
9-
font-family: "Manrope-Custom";
10-
src: url("/fonts/Manrope-Regular.ttf") format("truetype");
11-
font-weight: 400;
9+
font-family: Manrope-Custom;
1210
font-style: normal;
11+
font-weight: 400;
12+
src: url("/fonts/Manrope-Regular.ttf") format("truetype");
1313
}
1414

1515
@font-face {
16-
font-family: "Manrope-Custom";
17-
src: url("/fonts/Manrope-SemiBold.ttf") format("truetype");
18-
font-weight: 600;
16+
font-family: Manrope-Custom;
1917
font-style: normal;
18+
font-weight: 600;
19+
src: url("/fonts/Manrope-SemiBold.ttf") format("truetype");
2020
}
2121

client/src/app/styles/scss/vars.scss

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
@use './fonts.scss';
1+
@use './fonts';
22

33
:root {
4+
45
/* Шрифты */
56
--family-main: 'Manrope-Custom';
6-
77
--font-size-m: 16px;
88
--font-line-m: 24px;
99
--font-m: 16px / 24px var(--family-main);
10-
1110
--font-size-l: 24px;
1211
--font-line-l: 32px;
1312
--font-l: 24px / 32px var(--family-main);
14-
1513
--font-size-xl: 32px;
1614
--font-line-xl: 40px;
1715
--font-xl: 32px / 40px var(--family-main);
@@ -25,7 +23,7 @@
2523
--z-index-modal: 10;
2624

2725
/* Цвета */
28-
--overlay: rgba(0, 0, 0, 0.5);
26+
--overlay: rgb(0 0 0 / 0.5);
2927
--red-light: #ff0000;
3028
--red-dark: #c50a0a;
3129
--color-error: #ff0000;
@@ -38,6 +36,6 @@
3836

3937
/* Модальное окно */
4038

41-
--modal-background: #fff;
39+
--modal-background: #ffffff;
4240

4341
}

client/src/app/styles/themes/index.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@
22
--color-primary-dark: #0f4c81;
33
--color-primary: #2a73ff;
44
--color-primary-light: #dde8ff;
5-
65
--grad-1: #e8f1ff;
76
--grad-2: #c9ddff;
87
--grad-3: #8bb2ff;
98
--grad-4: #3b6ec8;
10-
119
--color-background: #eaf6ff;
1210
--color-section: #ffffff;
13-
1411
--color-title: #0a3d62;
1512
--color-text: #4a4a4a;
1613
--color-active-link: #dde8ff;
@@ -20,15 +17,12 @@
2017
--color-primary: #6366f1;
2118
--color-primary-light: #a5b4fc;
2219
--color-primary-dark: #4338ca;
23-
2420
--color-background: #0f172a;
2521
--color-section: #1e293b;
26-
2722
--grad-1: #1e293b;
2823
--grad-2: #334155;
2924
--grad-3: #475569;
3025
--grad-4: #64748b;
31-
3226
--color-title: #e2e8f0;
3327
--color-text: #cbd5e1;
3428
--color-active-link: #4338ca;

client/src/features/auth/model/hooks/useLoginForm.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ export const useLoginForm = () => {
1515
},
1616
});
1717

18+
const onSubmit = form.handleSubmit((values) => {
19+
alert(JSON.stringify(values));
20+
});
21+
1822
useEffect(() => {
1923
form.setFocus('login');
2024
}, [form, form.setFocus]);
2125

22-
const onSubmit = (values: LoginFormValues) => {
23-
alert(values?.login);
24-
};
25-
2626
return {
2727
form,
2828
onSubmit,

client/src/features/auth/model/hooks/useRegisterForm.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ export const useRegisterForm = () => {
2020
form.setFocus('email');
2121
}, [form, form.setFocus]);
2222

23-
const onSubmit = (values: RegisterFormValues) => {
24-
alert(values?.email);
25-
};
23+
const onSubmit = form.handleSubmit((values) => {
24+
alert(JSON.stringify(values));
25+
});
2626

2727
return {
2828
form,

0 commit comments

Comments
 (0)