From f3daa7d40d57bfc01070e470aba6036cd8af33cd Mon Sep 17 00:00:00 2001 From: Ben Woodward Date: Sat, 28 Aug 2021 09:12:42 -0700 Subject: Ensure page direction is set properly on first load (#209) Fixes #201 --- src/App.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index cf0ebd2..2601080 100644 --- a/src/App.js +++ b/src/App.js @@ -1,5 +1,5 @@ import { Button, Heading, Link, Pane, Paragraph } from 'evergreen-ui'; -import React, { useRef, useState } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; import logo from '../src/images/wifi.png'; import { Settings } from './components/Settings'; @@ -97,6 +97,13 @@ function App() { firstLoad.current = false; }; + useEffect(() => { + // Ensure the page direction is set properly on first load + if (htmlDirection() === 'rtl') { + html.style.direction = 'rtl'; + } + }); + return ( -- cgit v1.2.3