Skip to content

Commit f821bce

Browse files
authored
Merge branch 'dev' into removeComponentsFromTsconfig
2 parents b6078e7 + 2d4e990 commit f821bce

File tree

3 files changed

+3
-19
lines changed

3 files changed

+3
-19
lines changed

src/components/TranslationBanner.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@ import Emoji from "./Emoji"
99

1010
export interface IProps {
1111
shouldShow: boolean
12-
isPageRightToLeft: boolean
1312
originalPagePath: string
1413
isPageContentEnglish: boolean
1514
}
1615

1716
const TranslationBanner: React.FC<IProps> = ({
1817
shouldShow,
19-
isPageRightToLeft,
2018
originalPagePath,
2119
isPageContentEnglish,
2220
}) => {
@@ -60,7 +58,6 @@ const TranslationBanner: React.FC<IProps> = ({
6058
>
6159
<Flex
6260
flexDirection="column"
63-
alignItems={isPageRightToLeft ? "flex-end" : "flex-start"}
6461
m={4}
6562
mt={{ base: 10, sm: 4 }}
6663
>
@@ -115,7 +112,7 @@ const TranslationBanner: React.FC<IProps> = ({
115112
<CloseButton
116113
position="absolute"
117114
top="0"
118-
insetInlineEnd={isPageRightToLeft ? "auto" : 0}
115+
insetInlineEnd="0"
119116
margin={2}
120117
color="secondary"
121118
_hover={{

src/components/TranslationBannerLegal.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ import Translation from "./Translation"
1414

1515
export interface IProps {
1616
shouldShow: boolean
17-
isPageRightToLeft: boolean
1817
originalPagePath: string
1918
}
2019

2120
const TranslationBannerLegal: React.FC<IProps> = ({
2221
shouldShow,
2322
originalPagePath,
24-
isPageRightToLeft,
2523
}) => {
2624
// Default to isOpen being false, and let the useEffect set this.
2725
const [isOpen, setIsOpen] = useState(false)
@@ -61,12 +59,7 @@ const TranslationBannerLegal: React.FC<IProps> = ({
6159
md: "rgba(0, 0, 0, 0.16) 0px 2px 4px 0px",
6260
}}
6361
>
64-
<Flex
65-
direction="column"
66-
align={isPageRightToLeft ? "flex-end" : "flex-start"}
67-
m={4}
68-
mt={{ base: 10, sm: 4 }}
69-
>
62+
<Flex direction="column" m={4} mt={{ base: 10, sm: 4 }}>
7063
<Flex
7164
align={{ base: "flex-start", sm: "center" }}
7265
flexDirection={{ base: "column-reverse", sm: "row" }}
@@ -111,7 +104,7 @@ const TranslationBannerLegal: React.FC<IProps> = ({
111104
<CloseButton
112105
position="absolute"
113106
top={0}
114-
insetInlineEnd={isPageRightToLeft ? "auto" : 0}
107+
insetInlineEnd="0"
115108
margin={4}
116109
color="secondary"
117110
_hover={{

src/layouts/RootLayout.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { join } from "path"
33
import { useRouter } from "next/router"
44
import { Container } from "@chakra-ui/react"
55

6-
import { Lang } from "@/lib/types"
76
import { Root } from "@/lib/interfaces"
87

98
import FeedbackWidget from "@/components/FeedbackWidget"
@@ -13,7 +12,6 @@ import TranslationBanner from "@/components/TranslationBanner"
1312
import TranslationBannerLegal from "@/components/TranslationBannerLegal"
1413

1514
import { toPosixPath } from "@/lib/utils/relativePath"
16-
import { isLangRightToLeft } from "@/lib/utils/translations"
1715

1816
import { DEFAULT_LOCALE } from "@/lib/constants"
1917

@@ -47,8 +45,6 @@ export const RootLayout = ({
4745
(contentNotTranslated && !isPageLanguageEnglish)) &&
4846
!isLegal
4947
const shouldShowLegalTranslationBanner = isLegal && !isPageLanguageEnglish
50-
51-
const isPageRightToLeft = isLangRightToLeft(locale as Lang)
5248
const originalPagePath = toPosixPath(join(DEFAULT_LOCALE, asPath))
5349

5450
return (
@@ -58,13 +54,11 @@ export const RootLayout = ({
5854
<TranslationBanner
5955
shouldShow={shouldShowTranslationBanner}
6056
isPageContentEnglish={contentNotTranslated}
61-
isPageRightToLeft={isPageRightToLeft}
6257
originalPagePath={originalPagePath}
6358
/>
6459

6560
<TranslationBannerLegal
6661
shouldShow={shouldShowLegalTranslationBanner}
67-
isPageRightToLeft={isPageRightToLeft}
6862
originalPagePath={originalPagePath}
6963
/>
7064

0 commit comments

Comments
 (0)