Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix collapse icon on rtl layout

Chocobozzza3014a3897b9
diff --git a/client/src/app/menu/menu.component.html b/client/src/app/menu/menu.component.html
index da2790942c..3f504a0a31 100644
--- a/client/src/app/menu/menu.component.html
+++ b/client/src/app/menu/menu.component.html
@@ -28,11 +28,11 @@
<div class="toggle-menu-container">
@if (collapsed) {
<button type="button" class="button-unstyle toggle-menu" i18n-title title="Display the lateral menu" (click)="toggleMenu()">
- <my-global-icon class="transform-rotate-180" iconName="chevron-left"></my-global-icon>
+ <my-global-icon [class]="{ 'transform-rotate-180': !isRTL() }" iconName="chevron-left"></my-global-icon>
</button>
} @else {
<button type="button" class="button-unstyle toggle-menu" i18n-title title= "Hide the lateral menu" (click)="toggleMenu()">
- <my-global-icon iconName="chevron-left"></my-global-icon>
+ <my-global-icon [class]="{ 'transform-rotate-180': isRTL() }" iconName="chevron-left"></my-global-icon>
</button>
}
</div>
diff --git a/client/src/app/menu/menu.component.ts b/client/src/app/menu/menu.component.ts
index bae137b6e6..2cdaa3e35d 100644
--- a/client/src/app/menu/menu.component.ts
+++ b/client/src/app/menu/menu.component.ts
@@ -1,5 +1,5 @@
-import { CommonModule, NgTemplateOutlet } from '@angular/common'
-import { Component, inject, OnDestroy, OnInit } from '@angular/core'
+import { CommonModule, getLocaleDirection, NgTemplateOutlet } from '@angular/common'
+import { Component, inject, LOCALE_ID, OnDestroy, OnInit } from '@angular/core'
import { Params, RouterLink, RouterLinkActive } from '@angular/router'
import { AuthService, AuthStatus, AuthUser, HooksService, MenuService, RedirectService, ServerService, UserService } from '@app/core'
import { GlobalIconComponent, GlobalIconName } from '@app/shared/shared-icons/global-icon.component'
@@ -50,6 +50,7 @@ const debugLogger = debug('peertube:menu:MenuComponent')
export class MenuComponent implements OnInit, OnDestroy {
private authService = inject(AuthService)
private userService = inject(UserService)
+ private localeId = inject(LOCALE_ID)
private serverService = inject(ServerService)
private hooks = inject(HooksService)
private menu = inject(MenuService)
@@ -272,4 +273,8 @@ export class MenuComponent implements OnInit, OnDestroy {
this.buildMenuSections()
})
}
+
+ isRTL () {
+ return getLocaleDirection(this.localeId) === 'rtl'
+ }
}