aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBen Woodward <ben@bdw.to>2021-08-28 09:12:42 -0700
committerGitHub <noreply@github.com>2021-08-28 09:12:42 -0700
commitf3daa7d40d57bfc01070e470aba6036cd8af33cd (patch)
tree495f6c1290fca37e0cf4d1d4da1c96a4d5002dcb /src
parent00cceb952752a5a455d933392afb6aba75f21e2c (diff)
Ensure page direction is set properly on first load (#209)
Fixes #201
Diffstat (limited to 'src')
-rw-r--r--src/App.js9
1 files changed, 8 insertions, 1 deletions
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 @@
1import { Button, Heading, Link, Pane, Paragraph } from 'evergreen-ui'; 1import { Button, Heading, Link, Pane, Paragraph } from 'evergreen-ui';
2import React, { useRef, useState } from 'react'; 2import React, { useEffect, useRef, useState } from 'react';
3import { useTranslation } from 'react-i18next'; 3import { useTranslation } from 'react-i18next';
4import logo from '../src/images/wifi.png'; 4import logo from '../src/images/wifi.png';
5import { Settings } from './components/Settings'; 5import { Settings } from './components/Settings';
@@ -97,6 +97,13 @@ function App() {
97 firstLoad.current = false; 97 firstLoad.current = false;
98 }; 98 };
99 99
100 useEffect(() => {
101 // Ensure the page direction is set properly on first load
102 if (htmlDirection() === 'rtl') {
103 html.style.direction = 'rtl';
104 }
105 });
106
100 return ( 107 return (
101 <Pane> 108 <Pane>
102 <Pane display="flex"> 109 <Pane display="flex">