Merge branch 'mobile-modals' into 'develop'

Modal layout update

See merge request pleroma/pleroma-fe!1963
This commit is contained in:
HJ 2024-12-30 12:29:16 +00:00
commit a84424408d
4 changed files with 55 additions and 8 deletions

View file

@ -0,0 +1 @@
modal layout for mobile has new layout to make it easy to use

1
changelog.d/modals.fix Normal file
View file

@ -0,0 +1 @@
fixed modals buttons overflow

View file

@ -47,6 +47,9 @@ export default {
watch: { watch: {
themeApplied (value) { themeApplied (value) {
this.removeSplash() this.removeSplash()
},
layoutType (value) {
document.getElementById('modal').classList = ['-' + this.layoutType]
} }
}, },
created () { created () {
@ -54,6 +57,7 @@ export default {
const val = this.$store.getters.mergedConfig.interfaceLanguage const val = this.$store.getters.mergedConfig.interfaceLanguage
this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val }) this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val })
window.addEventListener('resize', this.updateMobileState) window.addEventListener('resize', this.updateMobileState)
document.getElementById('modal').classList = ['-' + this.layoutType]
}, },
mounted () { mounted () {
if (this.$store.state.interface.themeApplied) { if (this.$store.state.interface.themeApplied) {

View file

@ -1,5 +1,6 @@
<template> <template>
<span <span
class="dialog-container"
:class="{ 'dark-overlay': darkOverlay }" :class="{ 'dark-overlay': darkOverlay }"
@click.self.stop="onCancel()" @click.self.stop="onCancel()"
> >
@ -41,14 +42,21 @@
} }
} }
.dialog-modal.panel { .dialog-container {
display: grid;
position: fixed;
top: 0; top: 0;
left: 50%; bottom: 0;
left: 0;
right: 0;
justify-content: center;
align-items: center;
justify-items: center;
}
.dialog-modal.panel {
max-height: 80vh; max-height: 80vh;
max-width: 90vw; max-width: 90vw;
margin: 15vh auto;
position: fixed;
transform: translateX(-50%);
z-index: 2001; z-index: 2001;
cursor: default; cursor: default;
display: block; display: block;
@ -63,18 +71,51 @@
margin: 0; margin: 0;
padding: 1rem; padding: 1rem;
white-space: normal; white-space: normal;
text-align: center;
} }
.dialog-modal-footer { .dialog-modal-footer {
margin: 0; margin: 0;
padding: 0.5em; padding: 0.5em;
border-top: 1px solid var(--border); border-top: 1px solid var(--border);
display: flex; display: grid;
justify-content: flex-end; grid-gap: 0.5em;
grid-template-columns: min-content;
grid-auto-columns: min-content;
grid-auto-flow: column dense;
height: auto;
button { button {
width: auto; width: auto;
margin-left: 0.5rem; white-space: nowrap;
padding-left: 2em;
padding-right: 2em;
}
}
}
#modal.-mobile {
.dialog-container {
justify-content: stretch;
align-items: end;
justify-items: stretch;
}
.dialog-modal.panel {
min-width: 100vw;
}
.dialog-modal-footer {
flex-direction: column;
justify-content: flex-end;
grid-template-columns: 1fr;
grid-auto-columns: none;
grid-auto-rows: auto;
grid-auto-flow: row dense;
button {
grid-column: 1;
height: 3em;
} }
} }
} }