diff --git a/stylesheets/_session_signin.scss b/stylesheets/_session_signin.scss index 46fe3ff0a..8a7872f54 100644 --- a/stylesheets/_session_signin.scss +++ b/stylesheets/_session_signin.scss @@ -145,13 +145,6 @@ position: absolute; bottom: 0px; } - - .session-icon-button { - position: absolute; - top: 50%; - transform: translateY(-50%); - right: 0px; - } } &-terms-conditions-agreement { diff --git a/ts/components/basic/SessionInput.tsx b/ts/components/basic/SessionInput.tsx index 2143b7413..0c33a22b0 100644 --- a/ts/components/basic/SessionInput.tsx +++ b/ts/components/basic/SessionInput.tsx @@ -3,6 +3,7 @@ import React, { useState } from 'react'; import classNames from 'classnames'; import { SessionIconButton } from '../icon'; import { Noop } from '../../types/Util'; +import { useHTMLDirection } from '../../util/i18n'; type Props = { label?: string; @@ -46,7 +47,17 @@ const ErrorItem = (props: { error: string | undefined }) => { }; const ShowHideButton = (props: { toggleForceShow: Noop }) => { - return ; + const htmlDirection = useHTMLDirection(); + const position = htmlDirection === 'ltr' ? { right: '0px' } : { left: '0px' }; + + return ( + + ); }; export const SessionInput = (props: Props) => { diff --git a/ts/mains/main_renderer.tsx b/ts/mains/main_renderer.tsx index e66c8fb0a..ba2a7b516 100644 --- a/ts/mains/main_renderer.tsx +++ b/ts/mains/main_renderer.tsx @@ -267,13 +267,17 @@ async function start() { await connect(); }); - function openInbox() { + function switchBodyToRtlIfNeeded() { const rtlLocales = ['fa', 'ar', 'he']; const loc = (window.i18n as any).getLocale(); if (rtlLocales.includes(loc) && !document.getElementById('body')?.classList.contains('rtl')) { document.getElementById('body')?.classList.add('rtl'); } + } + + function openInbox() { + switchBodyToRtlIfNeeded(); const hideMenuBar = Storage.get('hide-menu-bar', true) as boolean; window.setAutoHideMenuBar(hideMenuBar); window.setMenuBarVisibility(!hideMenuBar); @@ -287,6 +291,7 @@ async function start() { function showRegistrationView() { ReactDOM.render(, document.getElementById('root')); + switchBodyToRtlIfNeeded(); } ExpirationTimerOptions.initExpiringMessageListener();