mirror of
https://github.com/lux-tel/session-desktop.git
synced 2026-10-30 20:33:24 +00:00
16 lines
354 B
TypeScript
16 lines
354 B
TypeScript
// RTL Support
|
|
|
|
export type HTMLDirection = 'ltr' | 'rtl';
|
|
|
|
export function isRtlBody(): boolean {
|
|
const body = document.getElementsByTagName('body').item(0);
|
|
|
|
return body?.classList.contains('rtl') || false;
|
|
}
|
|
|
|
export const useHTMLDirection = (): HTMLDirection => (isRtlBody() ? 'rtl' : 'ltr');
|
|
|
|
export function useIsRtl() {
|
|
return isRtlBody();
|
|
}
|