Skip to content

Commit

Permalink
submit button moved to mini components
Browse files Browse the repository at this point in the history
  • Loading branch information
Lvyshnevska committed Oct 9, 2024
1 parent bc53bcd commit 4ab8232
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 64 deletions.
16 changes: 16 additions & 0 deletions FrontEnd/src/components/MiniComponents/AdminSubmitButton.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import classes from './AdminSubmitButton.module.css';

const AdminSubmitButton = () => {
return (
<div className={classes['admin-submit__container']}>
<button
className={classes['admin-submit__button']}
type="submit"
>
Зберегти зміни
</button>
</div>
);
};

export default AdminSubmitButton;
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.admin-submit__container {
margin-top: 16px;
}

.admin-submit__button {
display: flex;
border-radius: 4px;
border: 1px solid var(--main-button-color);
background: var(--main-button-color);
box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.04);
color: var(--light-button-text-color);
font-feature-settings: 'calt' off;
font-style: normal;
padding: 5px 15px 5px 15px;
font-family: var(--font-main);
font-size: 16px;
font-weight: 600;
line-height: 20px;
letter-spacing: -0.01em;
text-align: center;
cursor: pointer;
}

.admin-submit__button:active {
transform: translateY(2px);
}
11 changes: 3 additions & 8 deletions FrontEnd/src/pages/AdminPage/AdminProfile/AdminInfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import axios from 'axios';
import { toast } from 'react-toastify';
import { useForm } from 'react-hook-form';

import AdminSubmitButton from '../../../components/MiniComponents/AdminSubmitButton';

import classes from './AdminInfo.module.css';

const AdminInfo = ({ user }) => {
Expand Down Expand Up @@ -126,14 +128,7 @@ const AdminInfo = ({ user }) => {
{errors.surname && errors.surname.message}
</div>
</div>
<div className={classes['admin-submit__container']}>
<button
className={classes['admin-submit__button']}
type="submit"
>
Зберегти
</button>
</div>
<AdminSubmitButton />
</div>
</form>
</div>
Expand Down
24 changes: 0 additions & 24 deletions FrontEnd/src/pages/AdminPage/AdminProfile/AdminInfo.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
.admin-info-form__container {
display: flex;
flex-direction: column;
gap: 8px;
flex-wrap: wrap;
}

Expand Down Expand Up @@ -108,26 +107,3 @@
font-weight: 400;
line-height: 16px;
}

.admin-submit__button {
display: flex;
border-radius: 4px;
border: 1px solid var(--main-button-color);
background: var(--main-button-color);
box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.04);
color: var(--light-button-text-color);
font-feature-settings: 'calt' off;
font-style: normal;
padding: 5px 15px 5px 15px;
font-family: var(--font-main);
font-size: 16px;
font-weight: 600;
line-height: 20px;
letter-spacing: -0.01em;
text-align: center;
cursor: pointer;
}

.admin-submit__button:active {
transform: translateY(2px);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useForm } from 'react-hook-form';

import PasswordField from '../../ProfilePage/FormComponents/FormFields/PasswordField';
import Loader from '../../../components/Loader/Loader';
import AdminSubmitButton from '../../../components/MiniComponents/AdminSubmitButton';

import classes from './ChangeAdminPassword.module.css';

Expand Down Expand Up @@ -96,15 +97,7 @@ export default function ChangeAdminPassword(props) {
checkWith: 'newPassword',
}}
/>

<div className={classes['admin-submit__container']}>
<button
className={classes['admin-submit__button']}
type="submit"
>
Змінити пароль
</button>
</div>
<AdminSubmitButton />
</form>
) : (
<Loader />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,3 @@
gap: 8px;
align-items: center;
}

.admin-submit__button {
display: flex;
border-radius: 4px;
border: 1px solid #1F9A7C;
background: #1F9A7C;
box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.04);
color: white;
font-feature-settings: 'calt' off;
font-style: normal;
padding: 5px 15px 5px 15px;
font-family: var(--font-main);
font-size: 16px;
font-weight: 600;
line-height: 20px;
letter-spacing: -0.01em;
text-align: center;
cursor: pointer;
}

.admin-submit__button:active {
transform: translateY(2px);
}

0 comments on commit 4ab8232

Please sign in to comment.