Skip to content

Commit 32f0931

Browse files
fix: Add close button to modal
1 parent 2d32f07 commit 32f0931

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

apps/website/src/components/BookACallModal.astro

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
import CloseCrossX from "./icons/CloseCrossX.astro";
23
import Modal from "./Modal.astro";
34
import Pill from "./Pill.astro";
45
@@ -13,10 +14,15 @@ const { calLink, eventType, modalId } = Astro.props;
1314

1415
<Modal
1516
id={modalId}
16-
classNames="w-[1017px] max-w-[calc(100%-16px)] p-7 max-h-[calc(100vh-64px)]"
17+
classNames="w-[1017px] max-w-[calc(100%-16px)] max-h-[calc(100vh-64px)]"
1718
>
18-
<section class="bg-white" slot="main">
19-
<header class="flex flex-col gap-4 items-center mb-8">
19+
<section class="p-7" slot="main">
20+
<header class="flex flex-col gap-4 items-center mb-8 relative">
21+
<button id="close-modal" class="absolute -top-3 -right-3 cursor-pointer"
22+
><span class="relative z-[-1]">
23+
<CloseCrossX />
24+
</span>
25+
</button>
2026
<Pill>Book your call today</Pill>
2127
<h2 class="text-4xl font-medium">
2228
Let's Build <span class="text-crocoder-green">Together</span>
@@ -134,7 +140,7 @@ const { calLink, eventType, modalId } = Astro.props;
134140

135141
const dialogElem = e.currentTarget;
136142

137-
if (e.target === dialogElem) {
143+
if (e.target === dialogElem || e.target.id === "close-modal") {
138144
dialogElem.close();
139145
}
140146
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<svg
2+
width="32"
3+
height="32"
4+
viewBox="0 0 32 32"
5+
fill="none"
6+
xmlns="http://www.w3.org/2000/svg"
7+
>
8+
<path
9+
d="M25.9072 5.59277L5.09277 26.4072M5.09277 5.59277L25.9072 26.4072"
10+
stroke="#3C3843"
11+
stroke-width="1.5"
12+
stroke-linecap="round"
13+
stroke-linejoin="round"></path>
14+
</svg>

0 commit comments

Comments
 (0)