From ff366a40751ef2110ff6c44751eb2737e8177d28 Mon Sep 17 00:00:00 2001 From: sebastian2357 <80636200+sebastian2357@users.noreply.github.com> Date: Fri, 9 May 2025 19:04:06 +0200 Subject: [PATCH] fix(webapp): mobile optimization (#8516) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * - optimized header - added possibility of extra mobile logo * - changed behavior of NotificationMenu link get directly open for mobile * - moved notification links to the top of the menu * - optimized chat view for mobile * - added logo branding structure * - added logo branding structure * - fixed chat height * - fixed paddings for internal pages * Fix linting * Fix linting --------- Co-authored-by: Sebastian Stein Co-authored-by: Wolfgang Huß --- backend/src/config/logos.ts | 11 +--- backend/src/config/logosBranded.ts | 32 ++++++++++ backend/src/emails/sendEmail.ts | 2 +- webapp/components/Chat/Chat.vue | 1 + webapp/components/HeaderMenu/HeaderMenu.vue | 27 +++++++-- webapp/components/Logo/Logo.vue | 59 ++++++++++++++----- .../NotificationMenu/NotificationMenu.vue | 19 +++++- .../features/InternalPage/InternalPage.vue | 13 ++++ .../_new/generic/BaseCard/BaseCard.story.js | 2 +- webapp/constants/logos.js | 23 +------- webapp/constants/logosBranded.js | 31 ++++++++++ webapp/layouts/basic.vue | 14 ++++- webapp/pages/chat.vue | 2 - 13 files changed, 177 insertions(+), 59 deletions(-) create mode 100644 backend/src/config/logosBranded.ts create mode 100644 webapp/constants/logosBranded.js diff --git a/backend/src/config/logos.ts b/backend/src/config/logos.ts index 41b83b30c..3c1db1128 100644 --- a/backend/src/config/logos.ts +++ b/backend/src/config/logos.ts @@ -1,10 +1,3 @@ -// this file is duplicated in `backend/src/config/logos` and `webapp/constants/logos.js` and replaced on rebranding +// this file is duplicated in `backend/src/config/logos.ts` and `webapp/constants/logos.js` and replaced on rebranding // this are the paths in the webapp -export default { - LOGO_HEADER_PATH: '/img/custom/logo-horizontal.svg', - LOGO_SIGNUP_PATH: '/img/custom/logo-squared.svg', - LOGO_WELCOME_PATH: '/img/custom/logo-squared.svg', - LOGO_LOGOUT_PATH: '/img/custom/logo-squared.svg', - LOGO_PASSWORD_RESET_PATH: '/img/custom/logo-squared.svg', - LOGO_MAINTENACE_RESET_PATH: '/img/custom/logo-squared.svg', -} +export default {} diff --git a/backend/src/config/logosBranded.ts b/backend/src/config/logosBranded.ts new file mode 100644 index 000000000..3c9a85861 --- /dev/null +++ b/backend/src/config/logosBranded.ts @@ -0,0 +1,32 @@ +// this file is duplicated in `backend/src/config/logos.ts` and `webapp/constants/logos.js` and replaced on rebranding +// this are the paths in the webapp +import { merge } from 'lodash' + +import logos from '@config/logos' + +const defaultLogos = { + LOGO_HEADER_PATH: '/img/custom/logo-horizontal.svg', + LOGO_HEADER_MOBILE_PATH: '/img/custom/logo-horizontal.svg', + LOGO_HEADER_WIDTH: '130px', + LOGO_HEADER_MOBILE_WIDTH: '100px', + LOGO_HEADER_CLICK: { + // externalLink: { + // url: 'https://ocelot.social', + // target: '_blank', + // }, + externalLink: null, + internalPath: { + to: { + name: 'index', + }, + scrollTo: '.main-navigation', + }, + }, + LOGO_SIGNUP_PATH: '/img/custom/logo-squared.svg', + LOGO_WELCOME_PATH: '/img/custom/logo-squared.svg', + LOGO_LOGOUT_PATH: '/img/custom/logo-squared.svg', + LOGO_PASSWORD_RESET_PATH: '/img/custom/logo-squared.svg', + LOGO_MAINTENACE_RESET_PATH: '/img/custom/logo-squared.svg', +} + +export default merge(defaultLogos, logos) diff --git a/backend/src/emails/sendEmail.ts b/backend/src/emails/sendEmail.ts index 6c44ae5e7..c8e14d74d 100644 --- a/backend/src/emails/sendEmail.ts +++ b/backend/src/emails/sendEmail.ts @@ -11,7 +11,7 @@ import { createTransport } from 'nodemailer' // import type Email as EmailType from '@types/email-templates' import CONFIG, { nodemailerTransportOptions } from '@config/index' -import logosWebapp from '@config/logos' +import logosWebapp from '@config/logosBranded' import metadata from '@config/metadata' import { UserDbProperties } from '@db/types/User' diff --git a/webapp/components/Chat/Chat.vue b/webapp/components/Chat/Chat.vue index faffa45e0..3a52982a5 100644 --- a/webapp/components/Chat/Chat.vue +++ b/webapp/components/Chat/Chat.vue @@ -17,6 +17,7 @@ :loading-rooms="loadingRooms" show-files="false" show-audio="false" + :height="'calc(100dvh - 190px)'" :styles="JSON.stringify(computedChatStyle)" :show-footer="true" :responsive-breakpoint="responsiveBreakpoint" diff --git a/webapp/components/HeaderMenu/HeaderMenu.vue b/webapp/components/HeaderMenu/HeaderMenu.vue index 26e6aede7..78813f51b 100644 --- a/webapp/components/HeaderMenu/HeaderMenu.vue +++ b/webapp/components/HeaderMenu/HeaderMenu.vue @@ -136,12 +136,12 @@ -
+
-
- +
+
@@ -284,7 +284,7 @@ import { mapGetters } from 'vuex' import isEmpty from 'lodash/isEmpty' import { SHOW_GROUP_BUTTON_IN_HEADER } from '~/constants/groups.js' import { SHOW_CONTENT_FILTER_HEADER_MENU } from '~/constants/filter.js' -import LOGOS from '~/constants/logos.js' +import LOGOS from '~/constants/logosBranded.js' import AvatarMenu from '~/components/AvatarMenu/AvatarMenu' import ChatNotificationMenu from '~/components/ChatNotificationMenu/ChatNotificationMenu' import CustomButton from '~/components/CustomButton/CustomButton' @@ -409,6 +409,25 @@ export default { flex-flow: row nowrap; align-items: center; justify-content: flex-end; + + & > div { + display: inline-flex; + + padding-right: 15px; + &:first-child { + padding-right: 10px; + } + + button { + overflow: visible; + .svg { + height: 1.8em; + } + } + } + .hamburger-button .svg { + height: 1.5em; + } } .mobile-menu { margin: 0 20px; diff --git a/webapp/components/Logo/Logo.vue b/webapp/components/Logo/Logo.vue index fee0d9140..b49bfebfb 100644 --- a/webapp/components/Logo/Logo.vue +++ b/webapp/components/Logo/Logo.vue @@ -1,29 +1,30 @@ + + diff --git a/webapp/components/_new/generic/BaseCard/BaseCard.story.js b/webapp/components/_new/generic/BaseCard/BaseCard.story.js index 928aba5e6..87c905fda 100644 --- a/webapp/components/_new/generic/BaseCard/BaseCard.story.js +++ b/webapp/components/_new/generic/BaseCard/BaseCard.story.js @@ -1,6 +1,6 @@ import { storiesOf } from '@storybook/vue' import helpers from '~/storybook/helpers' -import logos from '~/constants/logos.js' +import logos from '~/constants/logosBranded.js' import BaseCard from './BaseCard.vue' storiesOf('Generic/BaseCard', module) diff --git a/webapp/constants/logos.js b/webapp/constants/logos.js index 714e78a2c..163c2fd6a 100644 --- a/webapp/constants/logos.js +++ b/webapp/constants/logos.js @@ -1,24 +1,3 @@ // this file is duplicated in `backend/src/config/logos.js` and `webapp/constants/logos.js` and replaced on rebranding // this are the paths in the webapp -export default { - LOGO_HEADER_PATH: '/img/custom/logo-horizontal.svg', - LOGO_HEADER_WIDTH: '130px', - LOGO_HEADER_CLICK: { - // externalLink: { - // url: 'https://ocelot.social', - // target: '_blank', - // }, - externalLink: null, - internalPath: { - to: { - name: 'index', - }, - scrollTo: '.main-navigation', - }, - }, - LOGO_SIGNUP_PATH: '/img/custom/logo-squared.svg', - LOGO_WELCOME_PATH: '/img/custom/logo-squared.svg', - LOGO_LOGOUT_PATH: '/img/custom/logo-squared.svg', - LOGO_PASSWORD_RESET_PATH: '/img/custom/logo-squared.svg', - LOGO_MAINTENACE_RESET_PATH: '/img/custom/logo-squared.svg', -} +export default {} diff --git a/webapp/constants/logosBranded.js b/webapp/constants/logosBranded.js new file mode 100644 index 000000000..25d1541a6 --- /dev/null +++ b/webapp/constants/logosBranded.js @@ -0,0 +1,31 @@ +// this file is duplicated in `backend/src/config/logos.js` and `webapp/constants/logos.js` and replaced on rebranding +// this are the paths in the webapp +import { merge } from 'lodash' +import logos from '~/constants/logos' + +const defaultLogos = { + LOGO_HEADER_PATH: '/img/custom/logo-horizontal.svg', + LOGO_HEADER_MOBILE_PATH: '/img/custom/logo-horizontal.svg', + LOGO_HEADER_WIDTH: '130px', + LOGO_HEADER_MOBILE_WIDTH: '100px', + LOGO_HEADER_CLICK: { + // externalLink: { + // url: 'https://ocelot.social', + // target: '_blank', + // }, + externalLink: null, + internalPath: { + to: { + name: 'index', + }, + scrollTo: '.main-navigation', + }, + }, + LOGO_SIGNUP_PATH: '/img/custom/logo-squared.svg', + LOGO_WELCOME_PATH: '/img/custom/logo-squared.svg', + LOGO_LOGOUT_PATH: '/img/custom/logo-squared.svg', + LOGO_PASSWORD_RESET_PATH: '/img/custom/logo-squared.svg', + LOGO_MAINTENACE_RESET_PATH: '/img/custom/logo-squared.svg', +} + +export default merge(defaultLogos, logos) diff --git a/webapp/layouts/basic.vue b/webapp/layouts/basic.vue index 5eadb42af..ac0e63114 100644 --- a/webapp/layouts/basic.vue +++ b/webapp/layouts/basic.vue @@ -23,7 +23,7 @@
-
+
@@ -61,7 +61,7 @@ export default { } - diff --git a/webapp/pages/chat.vue b/webapp/pages/chat.vue index 9f93fabcb..0bb4def38 100644 --- a/webapp/pages/chat.vue +++ b/webapp/pages/chat.vue @@ -1,12 +1,10 @@