Skip to content

Commit 0860a96

Browse files
committed
fix: center single invoice modal
1 parent ca33fb9 commit 0860a96

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

packages/invoice-dashboard/src/lib/dashboard/drawer.svelte

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</script>
99

1010
<div
11-
class={`drawer-overlay ${active ? "active" : "hidden"}`}
11+
class={`drawer-overlay ${active ? "active-overlay" : "hidden"}`}
1212
on:click|stopPropagation={onClose}
1313
></div>
1414
<div bind:this={drawerElement} class={`drawer ${active ? "active" : "hidden"}`}>
@@ -28,7 +28,7 @@
2828
left: 0;
2929
right: 0;
3030
bottom: 0;
31-
background-color: rgba(0, 0, 0, 0.5);
31+
background-color: transparent;
3232
z-index: 200;
3333
}
3434
@@ -45,18 +45,19 @@
4545
}
4646
.drawer {
4747
z-index: 1000;
48-
display: flex;
49-
position: absolute;
50-
top: 10px;
51-
right: 10px;
48+
position: fixed;
49+
top: 50%;
50+
left: 50%;
5251
height: fit-content;
53-
display: flex;
5452
width: 800px;
55-
transition: all 300ms;
53+
54+
transform: translateX(0);
5655
}
5756
5857
@media only screen and (max-width: 880px) {
5958
.drawer {
59+
position: absolute;
60+
left: 50%;
6061
right: unset;
6162
width: 600px;
6263
}
@@ -100,7 +101,17 @@
100101
}
101102
102103
.active {
103-
transform: translateX(0);
104+
transform: translate(-50%, -50%);
105+
}
106+
107+
@media only screen and (max-width: 880px) {
108+
.active {
109+
transform: translate(-20%, -50%);
110+
}
111+
}
112+
113+
.active-overlay {
114+
background-color: rgba(0, 0, 0, 0.5);
104115
}
105116
106117
.hidden {

0 commit comments

Comments
 (0)