Skip to content

Commit 218be34

Browse files
feat: Add reviews/ to gitignore and introduce styling and responsiveness for OrderSuccessModal.
1 parent e563ed7 commit 218be34

File tree

3 files changed

+35
-6
lines changed

3 files changed

+35
-6
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,7 @@ next-env.d.ts
4242

4343
# app secrets
4444
/src/.secrets
45-
.secret_key.txt
45+
.secret_key.txt
46+
47+
# reviews
48+
reviews/

src/shared/ui/OrderSuccesModal/index.tsx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
'use client';
2-
import React from 'react';
2+
import React, { useMemo } from 'react';
33
import Typography from '@mui/material/Typography';
44
import { ModalComponent } from '@/shared/ui/Modal';
55
import { Box } from '@mui/material';
66
import s from './style.module.scss';
7+
import { useWindowWidth } from '@/shared/hooks';
78

89
type ModalComponentProps = {
910
open: boolean;
@@ -17,13 +18,27 @@ export const OrderSuccesModal: React.FC<ModalComponentProps> = ({
1718
const onClose = () => {
1819
setOpen(false);
1920
};
21+
const windowWidth = useWindowWidth();
22+
const style = useMemo(() => {
23+
if (windowWidth >= 420) return {};
24+
return { width: '90%', height: 'fit-content' };
25+
}, [windowWidth]);
2026
return (
21-
<ModalComponent withControl={false} open={open} onClose={onClose}>
22-
<div style={{ padding: 20 }}>
27+
<ModalComponent
28+
style={style}
29+
withControl={false}
30+
open={open}
31+
onClose={onClose}
32+
>
33+
<div className={s.container}>
2334
<Typography id="modal-modal-title" variant="h6" component="h2">
2435
Заказ успешно отправлен.
2536
</Typography>
26-
<Typography id="modal-modal-description" sx={{ mt: 2 }}>
37+
<Typography
38+
className={s.text}
39+
id="modal-modal-description"
40+
sx={{ mt: 2 }}
41+
>
2742
Представитель мастерской вам перезвонит для уточнения объема заказа.
2843
</Typography>
2944
<Box

src/shared/ui/OrderSuccesModal/style.module.scss

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.container {
2+
padding: 20px;
3+
background-color: #0a0a0a;
4+
}
15
.button {
26
all: unset;
37
border: 1px solid white;
@@ -10,7 +14,10 @@
1014
cursor: pointer;
1115
width: 300px;
1216
height: 35px;
13-
17+
@media (max-width: 350px) {
18+
width: 100%;
19+
height: fit-content;
20+
}
1421
&:hover {
1522
color: #e49e00;
1623
border-color: #e49e00;
@@ -20,3 +27,7 @@
2027
animation: pulseBorder 2s infinite;
2128
}
2229
}
30+
31+
.text {
32+
height: fit-content;
33+
}

0 commit comments

Comments
 (0)