Skip to content

Commit 17e0d91

Browse files
authored
Improve responsiveness of GenericModal component (#1367)
* Improve responsiveness of generic modal * Update GenericModal --md breakpoint vertical styles
1 parent 314473f commit 17e0d91

File tree

2 files changed

+21
-26
lines changed

2 files changed

+21
-26
lines changed

frontend/src/components/GenericModal.vue

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,11 @@ onUnmounted(() => {
6868
:scheme="AlertSchemes.Info"
6969
@close="infoMessage = null"
7070
/>
71-
<div class="pls-keep-height" v-else/>
7271
</div>
7372
<div class="modal-body">
7473
<slot></slot>
7574
</div>
76-
<div class="modal-actions">
75+
<div class="modal-actions" v-if="$slots.actions">
7776
<slot name="actions"></slot>
7877
</div>
7978
<div class="divider"></div>
@@ -93,7 +92,7 @@ onUnmounted(() => {
9392
display: flex;
9493
left: 0;
9594
top: 0;
96-
z-index: 55;
95+
z-index: 9999;
9796
width: 100vw;
9897
height: 100vh;
9998
overflow: hidden;
@@ -122,6 +121,7 @@ onUnmounted(() => {
122121
.modal-body {
123122
display: flex;
124123
width: 100%;
124+
height: 100%;
125125
flex-direction: column;
126126
align-items: center;
127127
}
@@ -139,14 +139,9 @@ onUnmounted(() => {
139139
flex-direction: column;
140140
justify-content: center;
141141
align-items: center;
142-
min-height: 8.0rem;
143142
width: 100%;
144143
gap: 1rem;
145-
}
146-
147-
/* Empty space if a notice bar isn't shown */
148-
.pls-keep-height {
149-
min-height: 2.0625rem; /* 33px */
144+
margin-block: 2rem;
150145
}
151146
152147
/* position-center apmt-background-color fixed z-[60] flex size-full gap-6 rounded-xl bg-white p-8 pb-0 drop-shadow-xl*/
@@ -164,6 +159,8 @@ onUnmounted(() => {
164159
padding: 1rem 1rem 0;
165160
overflow-y: scroll;
166161
overflow-x: hidden;
162+
display: flex;
163+
flex-direction: column;
167164
}
168165
169166
.dark .modal {
@@ -232,40 +229,38 @@ onUnmounted(() => {
232229
}
233230
234231
@media (--md) {
235-
.modal-header {
236-
margin-bottom: 0;
237-
}
238-
239232
.modal {
240-
width: 50rem; /* 800px */
241-
height: 37.5rem; /* 600px */
233+
width: 48rem; /* 768px */
242234
padding: 2rem 2rem 0;
243-
overflow: visible;
235+
overflow: hidden;
236+
height: min-content;
237+
max-height: 90vh;
238+
}
239+
240+
.modal-header {
241+
flex-shrink: 0;
244242
}
245243
246244
.modal-body {
247-
height: 15.0rem;
245+
overflow-y: auto;
246+
min-height: 0;
248247
}
249248
250249
.modal-actions {
251250
justify-content: center;
252-
position: absolute;
253-
left: 0;
254-
bottom: 5.75rem;
255-
margin: 0;
251+
margin-block: 2rem;
252+
flex-shrink: 0;
256253
}
257254
258255
.divider {
259-
position: absolute;
260-
bottom: 4rem;
261256
width: 50rem;
262257
margin: 0;
258+
flex-shrink: 0;
263259
}
264260
265261
.footer {
266-
position: absolute;
267-
left: 0;
268262
padding-bottom: 0;
263+
flex-shrink: 0;
269264
}
270265
}
271266

frontend/src/views/LoginView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ const onEnter = () => {
227227

228228
<template v-else>
229229
<div class="full-height-placeholder" />
230-
<generic-modal :error-message="loginError" @close="() => router.push({name: 'home'})">
230+
<generic-modal :error-message="loginError" @close="() => router.push({name: 'home'})" :closable="false">
231231
<template v-slot:header>
232232
<word-mark/>
233233
<h2 id="title" v-if="hideInviteField">

0 commit comments

Comments
 (0)