Skip to content

Commit 443e4ae

Browse files
committed
[#2] feat: add Modal component
1 parent c2a85d8 commit 443e4ae

File tree

5 files changed

+127
-8
lines changed

5 files changed

+127
-8
lines changed
Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1-
import { Header, SubHeader, Sidebar, Section } from "..";
1+
import { useState } from "react";
2+
import { Header, SubHeader, Sidebar, Section, Modal } from "..";
23

34
import styles from "./styles.module.scss";
45

56
export default function Layout() {
7+
const [showModal] = useState(false);
8+
69
return (
7-
<div className={styles.Container}>
8-
<Header />
9-
<SubHeader />
10-
<div className={styles.Wrapper}>
11-
<Sidebar />
12-
<Section />
10+
<>
11+
<div className={styles.Container}>
12+
<Header />
13+
<SubHeader />
14+
<div className={styles.Wrapper}>
15+
<Sidebar />
16+
<Section />
17+
</div>
18+
{showModal && <Modal />}
1319
</div>
14-
</div>
20+
<div className={showModal && styles.GrayLayer}></div>
21+
</>
1522
);
1623
}

client/src/components/Layout/styles.module.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
align-items: center;
88
height: 100vh;
99
width: 100vw;
10+
position: relative;
1011

1112
.Wrapper {
1213
display: flex;
@@ -16,3 +17,14 @@
1617
justify-content: space-between;
1718
}
1819
}
20+
.GrayLayer {
21+
position: absolute;
22+
top: 0;
23+
height: 100vh;
24+
width: 100vw;
25+
min-height: 100vh;
26+
min-width: 100vw;
27+
background-color: #e5e5e5;
28+
opacity: 0.5;
29+
z-index: 99;
30+
}

client/src/components/Modal/index.jsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import styles from "./styles.module.scss";
2+
3+
export default function Modal() {
4+
return (
5+
<div className={styles.Container}>
6+
<div className={styles.Header}>
7+
<h3>Ürünü silmek istediğinize emin misiniz?</h3>
8+
</div>
9+
<div className={styles.Body}>
10+
<p className={styles.Content}>
11+
Lorem Ipsum is simply dummy text of the printing and typesetting
12+
industry. Lorem Ipsum has been the industry's standard dummy text ever
13+
since the 1500s, when an unknown printer took a galley of type and
14+
scrambled it to make a type specimen book. It has survived not only
15+
five centuries, but also the leap into electronic typesetting,
16+
remaining essentiall....
17+
</p>
18+
</div>
19+
<div className={styles.Footer}>
20+
<button className={styles.Yes}>EVET</button>
21+
<button className={styles.No}>HAYIR</button>
22+
</div>
23+
</div>
24+
);
25+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
@use "../../global/variables.scss" as vars;
2+
3+
.Container {
4+
color: vars.$primary-font-color;
5+
max-width: 400px;
6+
width: 400px;
7+
height: 260px;
8+
background-color: #fff;
9+
border: 1px solid rgba(228, 228, 228, 0.6);
10+
box-shadow: 0px 6px 12px rgba(50, 50, 71, 0.07);
11+
border-radius: 4px;
12+
display: flex;
13+
flex-direction: column;
14+
justify-content: space-between;
15+
position: absolute;
16+
top: 250px;
17+
z-index: 999;
18+
19+
.Header {
20+
display: flex;
21+
align-items: center;
22+
padding-left: 18px;
23+
padding-right: 18px;
24+
border-bottom: 1px solid #cdcdcd;
25+
height: 60px;
26+
}
27+
28+
.Body {
29+
display: flex;
30+
align-items: center;
31+
font-weight: normal;
32+
padding-left: 20px;
33+
padding-right: 20px;
34+
padding-top: 16px;
35+
font-size: 12px;
36+
line-height: 17px;
37+
38+
.Content {
39+
font-weight: normal;
40+
font-size: 12px;
41+
}
42+
}
43+
44+
.Footer {
45+
display: flex;
46+
justify-content: flex-end;
47+
height: 56px;
48+
padding-right: 20px;
49+
align-items: flex-end;
50+
padding-bottom: 20px;
51+
52+
.Yes {
53+
background: #90d659;
54+
border-radius: 4px;
55+
width: 70px;
56+
height: 26px;
57+
outline: none;
58+
border: none;
59+
color: #fff;
60+
}
61+
62+
.No {
63+
margin-left: 10px;
64+
background: #d65959;
65+
width: 70px;
66+
height: 26px;
67+
border-radius: 4px;
68+
outline: none;
69+
border: none;
70+
color: #fff;
71+
}
72+
}
73+
}

client/src/components/index.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ export { default as ProductTable } from "./ProductTable";
1717
export { default as ProductRow } from "./ProductTable/ProductRow";
1818
export { default as ProductItem } from "./ProductTable/ProductItem";
1919
export { default as Pagination } from "./ProductTable/Pagination";
20+
export { default as AddButton } from "./AddButton";
21+
export { default as Modal } from "./Modal";

0 commit comments

Comments
 (0)