diff --git a/site/theme/static/common.less b/site/theme/static/common.less index baba11e0ec..9bf170ee1b 100644 --- a/site/theme/static/common.less +++ b/site/theme/static/common.less @@ -17,6 +17,8 @@ } html { + direction: initial; + &.rtl { direction: rtl; } diff --git a/site/theme/template/Layout/Header/Navigation.tsx b/site/theme/template/Layout/Header/Navigation.tsx index 16deea4355..fbd19169e9 100644 --- a/site/theme/template/Layout/Header/Navigation.tsx +++ b/site/theme/template/Layout/Header/Navigation.tsx @@ -13,7 +13,6 @@ import './Navigation.less'; export interface NavigationProps extends SharedProps { isMobile: boolean; - isRTL: boolean; pathname: string; responsive: null | 'narrow' | 'crowded'; location: { pathname: string; query: any }; diff --git a/site/theme/template/Layout/Header/index.tsx b/site/theme/template/Layout/Header/index.tsx index 71afac53e5..6666632864 100644 --- a/site/theme/template/Layout/Header/index.tsx +++ b/site/theme/template/Layout/Header/index.tsx @@ -186,7 +186,7 @@ const Header: React.FC> = props => { ); }, [location]); - const getNextDirectionText = useMemo( + const nextDirectionText = useMemo( () => (direction !== 'rtl' ? 'RTL' : 'LTR'), [direction], ); @@ -242,7 +242,7 @@ const Header: React.FC> = props => { isMobile={isMobile} showTechUIButton={showTechUIButton} pathname={pathname} - directionText={getNextDirectionText} + directionText={nextDirectionText} onLangChange={onLangChange} onDirectionChange={onDirectionChange} /> @@ -275,7 +275,7 @@ const Header: React.FC> = props => { className="header-button header-direction-button" key="direction-button" > - {getNextDirectionText} + {nextDirectionText} , , , diff --git a/site/theme/template/Layout/index.tsx b/site/theme/template/Layout/index.tsx index f2da3eaded..5afd43819d 100644 --- a/site/theme/template/Layout/index.tsx +++ b/site/theme/template/Layout/index.tsx @@ -226,6 +226,7 @@ export default class Layout extends React.Component