|
1 |
| -import { join } from "path" |
| 1 | +// import { join } from "path" |
2 | 2 |
|
3 |
| -import { useRouter } from "next/router" |
| 3 | +import dynamic from "next/dynamic" |
| 4 | +// import { useRouter } from "next/router" |
4 | 5 | import { Container } from "@chakra-ui/react"
|
5 | 6 |
|
6 | 7 | import type { Root } from "@/lib/types"
|
7 | 8 |
|
8 |
| -import FeedbackWidget from "@/components/FeedbackWidget" |
9 | 9 | import Footer from "@/components/Footer"
|
10 | 10 | import Nav from "@/components/Nav"
|
11 | 11 | 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" |
18 | 12 |
|
| 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" |
19 | 17 | import { lightTheme as oldTheme } from "../theme"
|
20 | 18 |
|
| 19 | +const FeedbackWidget = dynamic(() => import("@/components/FeedbackWidget"), { |
| 20 | + ssr: false, |
| 21 | +}) |
| 22 | + |
21 | 23 | export const RootLayout = ({
|
22 | 24 | children,
|
23 |
| - contentIsOutdated, |
24 |
| - contentNotTranslated, |
| 25 | + // contentIsOutdated, |
| 26 | + // contentNotTranslated, |
25 | 27 | lastDeployDate,
|
26 | 28 | }: 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)) |
| 29 | + // const { locale, asPath } = useRouter() |
| 30 | + |
| 31 | + // const CONTRIBUTING = "/contributing/" |
| 32 | + // const isUntranslatedContributingPage = |
| 33 | + // asPath.includes(CONTRIBUTING) && |
| 34 | + // !(asPath.endsWith(CONTRIBUTING) || asPath.includes("/translation-program/")) |
| 35 | + |
| 36 | + // const isLegal = |
| 37 | + // isUntranslatedContributingPage || |
| 38 | + // asPath.includes(`/cookie-policy/`) || |
| 39 | + // asPath.includes(`/privacy-policy/`) || |
| 40 | + // asPath.includes(`/terms-of-use/`) || |
| 41 | + // asPath.includes(`/style-guide/`) |
| 42 | + |
| 43 | + // const isPageLanguageEnglish = locale === DEFAULT_LOCALE |
| 44 | + |
| 45 | + // const shouldShowTranslationBanner = |
| 46 | + // (contentIsOutdated || (contentNotTranslated && !isPageLanguageEnglish)) && |
| 47 | + // !isLegal |
| 48 | + // const shouldShowLegalTranslationBanner = isLegal && !isPageLanguageEnglish |
| 49 | + // const originalPagePath = toPosixPath(join(DEFAULT_LOCALE, asPath)) |
48 | 50 |
|
49 | 51 | return (
|
50 | 52 | <Container mx="auto" maxW={oldTheme.variables.maxPageWidth}>
|
|
0 commit comments