feat: add toaster
This commit is contained in:
1
src/widgets/offer-form/index.ts
Normal file
1
src/widgets/offer-form/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { default as OfferForm } from './ui';
|
||||
31
src/widgets/offer-form/styles.module.scss
Normal file
31
src/widgets/offer-form/styles.module.scss
Normal file
@@ -0,0 +1,31 @@
|
||||
.RowForm {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
gap: rem(10px);
|
||||
margin-bottom: rem(80px);
|
||||
|
||||
@include iftablet {
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
gap: rem(10px);
|
||||
}
|
||||
|
||||
@include iflaptop {
|
||||
justify-content: center;
|
||||
gap: rem(20px);
|
||||
}
|
||||
|
||||
@include ifdesktop {
|
||||
justify-content: center;
|
||||
gap: rem(40px);
|
||||
}
|
||||
|
||||
.Unit {
|
||||
width: 300px;
|
||||
@include iftablet {
|
||||
width: unset;
|
||||
}
|
||||
}
|
||||
}
|
||||
27
src/widgets/offer-form/ui.tsx
Normal file
27
src/widgets/offer-form/ui.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
'use client';
|
||||
|
||||
import s from './styles.module.scss';
|
||||
import { Button, Input } from '@shared/ui';
|
||||
import { useState } from 'react';
|
||||
import toast from 'react-hot-toast';
|
||||
|
||||
export default function OfferForm() {
|
||||
const [name, setName] = useState('');
|
||||
const notify = () => toast.success('Заявка на консультацию принята');
|
||||
|
||||
return (
|
||||
<form className={s.RowForm}>
|
||||
<Input className={s.Unit} type='text' placeholder='+7 (999) 123 45 67' />
|
||||
<Input
|
||||
className={s.Unit}
|
||||
type='text'
|
||||
placeholder='Ваше имя'
|
||||
value={name}
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
/>
|
||||
<Button className={s.Unit} variant='orange' onClick={notify}>
|
||||
Получить консультацию
|
||||
</Button>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user