Skip to content

Commit

Permalink
fix(NcAppDetailsToggle): Rtl support
Browse files Browse the repository at this point in the history
Signed-off-by: Hamza Mahjoubi <[email protected]>
  • Loading branch information
hamza221 committed Oct 14, 2024
1 parent 24e8827 commit 45f846c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/components/NcAppContent/NcAppDetailsToggle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
class="app-details-toggle"
:class="{ 'app-details-toggle--mobile': isMobile }">
<template #icon>
<ArrowRight :size="20" />
<ArrowLeft v-if="isRTL" :size="20" />
<ArrowRight v-else :size="20" />
</template>
</NcButton>
</template>
Expand All @@ -23,7 +24,10 @@ import Tooltip from '../../directives/Tooltip/index.js'
import { emit } from '@nextcloud/event-bus'
import ArrowRight from 'vue-material-design-icons/ArrowRight.vue'
import ArrowLeft from 'vue-material-design-icons/ArrowLeft.vue'
import { useIsMobile } from '../../composables/useIsMobile/index.js'
import { getLanguage, isRTL } from '@nextcloud/l10n'
export default {
name: 'NcAppDetailsToggle',
Expand All @@ -35,6 +39,7 @@ export default {
components: {
NcButton,
ArrowRight,
ArrowLeft,
},
setup() {
return {
Expand All @@ -46,6 +51,9 @@ export default {
title() {
return t('Go back to the list')
},
isRTL() {
return isRTL(getLanguage())
},
},
watch: {
isMobile: {
Expand Down Expand Up @@ -92,10 +100,10 @@ export default {
top: var(--app-navigation-padding);
// Navigation Toggle button width + 2 paddings around
left: calc(var(--default-clickable-area) + var(--app-navigation-padding) * 2);
inset-inline-start: calc(var(--default-clickable-area) + var(--app-navigation-padding) * 2);
&--mobile {
// There is no NavigationToggle button
left: var(--app-navigation-padding);
inset-inline-start: var(--app-navigation-padding);
}
&:active,
Expand Down

0 comments on commit 45f846c

Please sign in to comment.