From 17f9f0baa9d95badbc83a0849a888c7477e524c2 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 7 Jun 2019 20:04:35 -0400 Subject: [PATCH] feat: rtl display + dark theme improvements --- client/client-app.js | 4 +- client/components/admin.vue | 2 +- client/components/admin/admin-locale.vue | 6 + client/components/common/nav-header.vue | 5 + client/scss/base/base.scss | 13 +++ client/store/site.js | 2 +- .../themes/default/components/nav-footer.vue | 2 +- client/themes/default/components/page.vue | 28 +++-- client/themes/default/scss/app.scss | 109 +++++++++++++----- dev/templates/master.pug | 2 +- server/app/data.yml | 1 + server/graph/resolvers/localization.js | 4 + server/views/master.pug | 2 +- 13 files changed, 138 insertions(+), 42 deletions(-) diff --git a/client/client-app.js b/client/client-app.js index 45e2fbe5..f1ad55ed 100644 --- a/client/client-app.js +++ b/client/client-app.js @@ -139,7 +139,9 @@ Vue.use(VueClipboards) Vue.use(localization.VueI18Next) Vue.use(helpers) Vue.use(VeeValidate, { events: '' }) -Vue.use(Vuetify) +Vue.use(Vuetify, { + rtl: siteConfig.rtl +}) Vue.use(VueMoment, { moment }) Vue.use(Vuescroll) Vue.use(VueTour) diff --git a/client/components/admin.vue b/client/components/admin.vue index ee7cd737..297c1bc9 100644 --- a/client/components/admin.vue +++ b/client/components/admin.vue @@ -5,7 +5,7 @@ v-spacer .subheading.grey--text Administration Area v-spacer - v-navigation-drawer.pb-0.admin-sidebar(v-model='adminDrawerShown', app, fixed, clipped, left, permanent) + v-navigation-drawer.pb-0.admin-sidebar(v-model='adminDrawerShown', app, fixed, clipped, :right='$vuetify.rtl', permanent) vue-scroll(:ops='scrollStyle') v-list(dense) v-list-tile.pt-2(to='/dashboard') diff --git a/client/components/admin/admin-locale.vue b/client/components/admin/admin-locale.vue index aac7e715..e16d17df 100644 --- a/client/components/admin/admin-locale.vue +++ b/client/components/admin/admin-locale.vue @@ -199,8 +199,14 @@ export default { }) const resp = _.get(respRaw, 'data.localization.updateLocale.responseResult', {}) if (resp.succeeded) { + // Change UI language WIKI.$i18n.i18next.changeLanguage(this.selectedLocale) WIKI.$moment.locale(this.selectedLocale) + + // Check for RTL + const curLocale = _.find(this.locales, ['code', this.selectedLocale]) + this.$vuetify.rtl = curLocale && curLocale.isRTL + this.$store.commit('showNotification', { message: 'Locale settings updated successfully.', style: 'success', diff --git a/client/components/common/nav-header.vue b/client/components/common/nav-header.vue index 27506b2f..45d9b5d8 100644 --- a/client/components/common/nav-header.vue +++ b/client/components/common/nav-header.vue @@ -373,6 +373,11 @@ export default { right: 12px; border-radius: 4px !important; + @at-root .application--is-rtl & { + right: initial; + left: 12px; + } + &::before { border-radius: 4px !important; } diff --git a/client/scss/base/base.scss b/client/scss/base/base.scss index b9b07d79..f414c539 100644 --- a/client/scss/base/base.scss +++ b/client/scss/base/base.scss @@ -63,3 +63,16 @@ html { border-color: lighten(mc('grey', '900'), percentage($i/100)) !important; } } +.grey.darken-5 { + background-color: #0C0C0C !important; + border-color: #0C0C0C !important; +} + +.blue.darken-5 { + background-color: darken(mc('blue', '900'), 20%) !important; + border-color: darken(mc('blue', '900'), 20%) !important; +} +.indigo.darken-5 { + background-color: darken(mc('indigo', '900'), 10%) !important; + border-color: darken(mc('indigo', '900'), 10%) !important; +} diff --git a/client/store/site.js b/client/store/site.js index dc79571c..d54e5e60 100644 --- a/client/store/site.js +++ b/client/store/site.js @@ -3,7 +3,7 @@ import { make } from 'vuex-pathify' /* global siteConfig */ const state = { - company: '', + company: siteConfig.company, dark: siteConfig.darkMode, mascot: true, title: siteConfig.title, diff --git a/client/themes/default/components/nav-footer.vue b/client/themes/default/components/nav-footer.vue index a039ed06..4beb080c 100644 --- a/client/themes/default/components/nav-footer.vue +++ b/client/themes/default/components/nav-footer.vue @@ -6,7 +6,7 @@