commit: a84424408dc787b922474e932f5e37758e20c189
parent 86e1e6becf6afaf9bde9681ea0884ca37a54e3dc
Author: HJ <30-hj@users.noreply.git.pleroma.social>
Date: Mon, 30 Dec 2024 12:29:16 +0000
Merge branch 'mobile-modals' into 'develop'
Modal layout update
See merge request pleroma/pleroma-fe!1963
Diffstat:
4 files changed, 55 insertions(+), 8 deletions(-)
diff --git a/changelog.d/modals-mobile.change b/changelog.d/modals-mobile.change
@@ -0,0 +1 @@
+modal layout for mobile has new layout to make it easy to use
diff --git a/changelog.d/modals.fix b/changelog.d/modals.fix
@@ -0,0 +1 @@
+fixed modals buttons overflow
diff --git a/src/App.js b/src/App.js
@@ -47,6 +47,9 @@ export default {
watch: {
themeApplied (value) {
this.removeSplash()
+ },
+ layoutType (value) {
+ document.getElementById('modal').classList = ['-' + this.layoutType]
}
},
created () {
@@ -54,6 +57,7 @@ export default {
const val = this.$store.getters.mergedConfig.interfaceLanguage
this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val })
window.addEventListener('resize', this.updateMobileState)
+ document.getElementById('modal').classList = ['-' + this.layoutType]
},
mounted () {
if (this.$store.state.interface.themeApplied) {
diff --git a/src/components/dialog_modal/dialog_modal.vue b/src/components/dialog_modal/dialog_modal.vue
@@ -1,5 +1,6 @@
<template>
<span
+ class="dialog-container"
:class="{ 'dark-overlay': darkOverlay }"
@click.self.stop="onCancel()"
>
@@ -41,14 +42,21 @@
}
}
-.dialog-modal.panel {
+.dialog-container {
+ display: grid;
+ position: fixed;
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-width: 90vw;
- margin: 15vh auto;
- position: fixed;
- transform: translateX(-50%);
z-index: 2001;
cursor: default;
display: block;
@@ -63,18 +71,51 @@
margin: 0;
padding: 1rem;
white-space: normal;
+ text-align: center;
}
.dialog-modal-footer {
margin: 0;
padding: 0.5em;
border-top: 1px solid var(--border);
- display: flex;
- justify-content: flex-end;
+ display: grid;
+ grid-gap: 0.5em;
+ grid-template-columns: min-content;
+ grid-auto-columns: min-content;
+ grid-auto-flow: column dense;
+ height: auto;
button {
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;
}
}
}