Skip to content

Commit 5cb52ac

Browse files
committed
chore: comment out code not being used temporally until banner logix is fixed
1 parent a8cf83a commit 5cb52ac

File tree

1 file changed

+29
-31
lines changed

1 file changed

+29
-31
lines changed

src/layouts/RootLayout.tsx

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,48 @@
1-
import { join } from "path"
1+
// import { join } from "path"
22

33
import dynamic from "next/dynamic"
4-
import { useRouter } from "next/router"
4+
// import { useRouter } from "next/router"
55
import { Container } from "@chakra-ui/react"
66

77
import type { Root } from "@/lib/types"
88

99
import Footer from "@/components/Footer"
1010
import Nav from "@/components/Nav"
1111
import { SkipLink } from "@/components/SkipLink"
12-
import TranslationBanner from "@/components/TranslationBanner"
13-
import TranslationBannerLegal from "@/components/TranslationBannerLegal"
14-
15-
import { toPosixPath } from "@/lib/utils/relativePath"
16-
17-
import { DEFAULT_LOCALE } from "@/lib/constants"
1812

13+
// import TranslationBanner from "@/components/TranslationBanner"
14+
// import TranslationBannerLegal from "@/components/TranslationBannerLegal"
15+
// import { toPosixPath } from "@/lib/utils/relativePath"
16+
// import { DEFAULT_LOCALE } from "@/lib/constants"
1917
import { lightTheme as oldTheme } from "../theme"
2018

2119
export const RootLayout = ({
2220
children,
23-
contentIsOutdated,
24-
contentNotTranslated,
21+
// contentIsOutdated,
22+
// contentNotTranslated,
2523
lastDeployDate,
2624
}: Root) => {
27-
const { locale, asPath } = useRouter()
28-
29-
const CONTRIBUTING = "/contributing/"
30-
const isUntranslatedContributingPage =
31-
asPath.includes(CONTRIBUTING) &&
32-
!(asPath.endsWith(CONTRIBUTING) || asPath.includes("/translation-program/"))
33-
34-
const isLegal =
35-
isUntranslatedContributingPage ||
36-
asPath.includes(`/cookie-policy/`) ||
37-
asPath.includes(`/privacy-policy/`) ||
38-
asPath.includes(`/terms-of-use/`) ||
39-
asPath.includes(`/style-guide/`)
40-
41-
const isPageLanguageEnglish = locale === DEFAULT_LOCALE
42-
43-
const shouldShowTranslationBanner =
44-
(contentIsOutdated || (contentNotTranslated && !isPageLanguageEnglish)) &&
45-
!isLegal
46-
const shouldShowLegalTranslationBanner = isLegal && !isPageLanguageEnglish
47-
const originalPagePath = toPosixPath(join(DEFAULT_LOCALE, asPath))
25+
// const { locale, asPath } = useRouter()
26+
27+
// const CONTRIBUTING = "/contributing/"
28+
// const isUntranslatedContributingPage =
29+
// asPath.includes(CONTRIBUTING) &&
30+
// !(asPath.endsWith(CONTRIBUTING) || asPath.includes("/translation-program/"))
31+
32+
// const isLegal =
33+
// isUntranslatedContributingPage ||
34+
// asPath.includes(`/cookie-policy/`) ||
35+
// asPath.includes(`/privacy-policy/`) ||
36+
// asPath.includes(`/terms-of-use/`) ||
37+
// asPath.includes(`/style-guide/`)
38+
39+
// const isPageLanguageEnglish = locale === DEFAULT_LOCALE
40+
41+
// const shouldShowTranslationBanner =
42+
// (contentIsOutdated || (contentNotTranslated && !isPageLanguageEnglish)) &&
43+
// !isLegal
44+
// const shouldShowLegalTranslationBanner = isLegal && !isPageLanguageEnglish
45+
// const originalPagePath = toPosixPath(join(DEFAULT_LOCALE, asPath))
4846

4947
const FeedbackWidget = dynamic(() => import("@/components/FeedbackWidget"), {
5048
ssr: false,

0 commit comments

Comments
 (0)