Skip to content
This repository was archived by the owner on Feb 22, 2025. It is now read-only.

Commit 91d74be

Browse files
committed
wip
1 parent 44d3249 commit 91d74be

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+839
-1084
lines changed

.env.local.example

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
# NODE_TLS_REJECT_UNAUTHORIZED=0
22

3-
NEXT_PUBLIC_DRUPAL_BASE_URL="https://domain.ddev.site"
4-
NEXT_IMAGE_DOMAIN="domain.ddev.site"
3+
NEXT_PUBLIC_SITE_URL=""
4+
NEXT_PUBLIC_GTM_ID=""
55

6-
DRUPAL_SITE_ID=""
7-
DRUPAL_FRONT_PAGE=""
6+
# See https://next-drupal.org/docs/environment-variables
7+
8+
# Required
9+
NEXT_PUBLIC_DRUPAL_BASE_URL=""
10+
NEXT_IMAGE_DOMAIN=""
11+
12+
# Required for Preview Mode
813
DRUPAL_PREVIEW_SECRET=""
914

15+
# Authentication (Bearer)
1016
# Retrieve this from /admin/config/services/consumer
1117
# user: apibot
1218
DRUPAL_CLIENT_ID=""
1319
DRUPAL_CLIENT_SECRET=""
20+
21+
# Optional
22+
DRUPAL_SITE_ID=""
23+
DRUPAL_FRONT_PAGE=""

.github/workflows/pagespeed.yml

-39
This file was deleted.

README.md

-8
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,3 @@ You can check out [the Next.js GitHub repository](https://github.com/vercel/next
3939
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
4040

4141
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
42-
43-
## Pagespeed Insights Mobile
44-
45-
[![Pagespeed Insights Mobile](reports/psresultmobile.svg "Pagespeed Insights Mobile")](https://pagespeed.web.dev/report?url=https://starter.wakelabstudio.ru&form_factor=mobile)
46-
47-
## Pagespeed Insights Desktop
48-
49-
[![Pagespeed Insights Desktop](reports/psresultdesktop.svg "Pagespeed Insights Desktop")](https://pagespeed.web.dev/report?url=https://starter.wakelabstudio.ru&form_factor=desktop)

components/Icons/IconClose.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Icon } from "@chakra-ui/icons";
2-
3-
import type { ChakraProps } from "@chakra-ui/system";
2+
import { ChakraProps } from "@chakra-ui/system";
43

54
const IconClose = (props: ChakraProps) => (
65
<Icon viewBox="0 0 26 26" fill="currentColor" {...props}>

components/Icons/IconMenu.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Icon } from "@chakra-ui/icons";
2-
3-
import type { ChakraProps } from "@chakra-ui/system";
2+
import { ChakraProps } from "@chakra-ui/system";
43

54
const IconMenu = (props: ChakraProps) => (
65
<Icon viewBox="0 0 26 26" fill="currentColor" {...props}>

components/Layout/BPIndicator.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import React from "react";
1+
import { useEffect, useState } from "react";
22

33
import { Flex } from "@chakra-ui/layout";
44
import { useBreakpoint } from "@chakra-ui/media-query";
55

66
const BPIndicator = () => {
77
const currentBP = useBreakpoint();
8-
const [show, setShow] = React.useState(false);
8+
const [show, setShow] = useState(false);
99

10-
React.useEffect(() => {
10+
useEffect(() => {
1111
!process.env.NODE_ENV ||
1212
(process.env.NODE_ENV === "development" && setShow(true));
1313
}, []);

components/Layout/Container.tsx

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { Flex } from "@chakra-ui/layout";
1+
import { Flex, FlexProps } from "@chakra-ui/layout";
22
import { forwardRef } from "@chakra-ui/system";
33

4-
import type { FlexProps } from "@chakra-ui/layout";
5-
64
const Container = forwardRef<FlexProps, "div">((props, ref) => (
75
<Flex
86
ref={ref}
@@ -12,23 +10,19 @@ const Container = forwardRef<FlexProps, "div">((props, ref) => (
1210
marginY={{ base: "20", lg: "30", lx: "40" }}
1311
minWidth={{
1412
base: "container.min",
15-
// xs: "container.min",
1613
sm: "container.sm",
1714
md: "container.md",
1815
lg: "container.lg",
1916
xl: "container.xl",
20-
// xxl: "container.xxl",
2117
"2xl": "container.2xl",
2218
// "3xl": "container.3xl",
2319
}}
2420
maxWidth={{
2521
base: "container.base",
26-
// xs: "container.xs",
2722
sm: "container.sm",
2823
md: "container.md",
2924
lg: "container.lg",
3025
xl: "container.xl",
31-
// xxl: "container.xxl",
3226
"2xl": "container.2xl",
3327
// "3xl": "container.3xl",
3428
}}

components/Layout/Footer.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { useTranslation } from "next-i18next";
22
import dynamic from "next/dynamic";
3-
import React from "react";
43

54
import { Flex, Link, Text } from "@chakra-ui/layout";
65

7-
const Wrapper = dynamic(() => import("@components/Layout/Wrapper"));
8-
const Container = dynamic(() => import("@components/Layout/Container"));
9-
const LogoWakeLab = dynamic(() => import("@components/Logos/LogoWakeLab"));
6+
const Wrapper = dynamic(() => import("@/components/Layout/Wrapper"));
7+
const Container = dynamic(() => import("@/components/Layout/Container"));
8+
const LogoWakeLab = dynamic(() => import("@/components/Logos/LogoWakeLab"));
109

1110
const Footer = () => {
1211
const { t } = useTranslation("common");

components/Layout/HeaderDesktop.tsx

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
11
import { useScroll } from "framer-motion";
22
import dynamic from "next/dynamic";
3-
import React from "react";
3+
import { useCallback, useEffect, useState } from "react";
44

5+
import LogoBox from "@/components/Logos/LogoBox";
56
import { Flex, Grid } from "@chakra-ui/layout";
6-
import LogoBox from "@components/Logos/LogoBox";
77

8-
const Wrapper = dynamic(() => import("@components/Layout/Wrapper"));
9-
const Container = dynamic(() => import("@components/Layout/Container"));
8+
const Wrapper = dynamic(() => import("@/components/Layout/Wrapper"));
9+
const Container = dynamic(() => import("@/components/Layout/Container"));
1010
const LanguageSwitcher = dynamic(
11-
() => import("@components/Layout/LanguageSwitcher")
11+
() => import("@/components/Layout/LanguageSwitcher")
1212
);
13-
const Nav = dynamic(() => import("@components/Layout/Nav"));
14-
// const SearchBox = dynamic(() => import("@components/Layout/SearchBox"));
13+
const Nav = dynamic(() => import("@/components/Layout/Nav"));
1514

1615
const HeaderDesktop = () => {
1716
const { scrollY } = useScroll();
18-
const [isScrolled, setIsScrolled] = React.useState(false);
17+
const [isScrolled, setIsScrolled] = useState(false);
1918

20-
React.useEffect(() => {
19+
useEffect(() => {
2120
scrollY.onChange(() => {
2221
const scrolled = scrollY.get() > 300;
2322
if (scrolled !== isScrolled) setIsScrolled(scrolled);
2423
});
2524
}, [isScrolled, scrollY]);
2625

27-
const Bar = React.useCallback(
26+
const Bar = useCallback(
2827
() => (
2928
<>
3029
<Grid gridTemplateColumns="repeat(12,1fr)" width="full">
@@ -61,7 +60,7 @@ const HeaderDesktop = () => {
6160
[]
6261
);
6362

64-
const HeaderDesktopStatic = React.useCallback(
63+
const HeaderDesktopStatic = useCallback(
6564
() => (
6665
<Wrapper
6766
as="header"
@@ -87,7 +86,7 @@ const HeaderDesktop = () => {
8786
[Bar]
8887
);
8988

90-
const HeaderDesktopSticky = React.useCallback(
89+
const HeaderDesktopSticky = useCallback(
9190
() => (
9291
<Wrapper
9392
as="header"

components/Layout/HeaderMobile.tsx

+17-17
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,40 @@ import { useScroll } from "framer-motion";
22
import { useTranslation } from "next-i18next";
33
import dynamic from "next/dynamic";
44
import { useRouter } from "next/router";
5-
import React from "react";
5+
import { SyntheticEvent, useCallback, useEffect, useState } from "react";
66

7+
import LogoBox from "@/components/Logos/LogoBox";
78
import { IconButton } from "@chakra-ui/button";
89
import { Flex } from "@chakra-ui/layout";
9-
import LogoBox from "@components/Logos/LogoBox";
1010

11-
const Wrapper = dynamic(() => import("@components/Layout/Wrapper"));
12-
const Container = dynamic(() => import("@components/Layout/Container"));
13-
const IconClose = dynamic(() => import("@icons/IconClose"));
14-
const IconMenu = dynamic(() => import("@components/Icons/IconMenu"));
11+
const Wrapper = dynamic(() => import("@/components/Layout/Wrapper"));
12+
const Container = dynamic(() => import("@/components/Layout/Container"));
13+
const IconClose = dynamic(() => import("@/icons/IconClose"));
14+
const IconMenu = dynamic(() => import("@/components/Icons/IconMenu"));
1515

1616
const LanguageSwitcher = dynamic(
17-
() => import("@components/Layout/LanguageSwitcher")
17+
() => import("@/components/Layout/LanguageSwitcher")
1818
);
1919

20-
const Nav = dynamic(() => import("@components/Layout/Nav"));
21-
// const SearchBox = dynamic(() => import("@components/Layout/SearchBox"));
20+
const Nav = dynamic(() => import("@/components/Layout/Nav"));
21+
// const SearchBox = dynamic(() => import("@/components/Layout/SearchBox"));
2222

2323
const HeaderMobile = () => {
2424
const { t } = useTranslation("common");
2525
const { events } = useRouter();
2626
const { scrollY } = useScroll();
27-
const [extendedState, setExtendedState] = React.useState(false);
28-
const [isForwardScroll, setIsForwardScroll] = React.useState(false);
27+
const [extendedState, setExtendedState] = useState(false);
28+
const [isForwardScroll, setIsForwardScroll] = useState(false);
2929

30-
const toggleExtendedState = React.useCallback(
31-
(e: React.SyntheticEvent) => {
30+
const toggleExtendedState = useCallback(
31+
(e: SyntheticEvent) => {
3232
e.preventDefault();
3333
setExtendedState(!extendedState);
3434
},
3535
[extendedState]
3636
);
3737

38-
React.useEffect(() => {
38+
useEffect(() => {
3939
const handleRouteChange = () => {
4040
setExtendedState(false);
4141
};
@@ -45,14 +45,14 @@ const HeaderMobile = () => {
4545
};
4646
}, [events]);
4747

48-
React.useEffect(() => {
48+
useEffect(() => {
4949
scrollY.onChange(() => {
5050
const forwardScroll = scrollY.get() > scrollY.getPrevious();
5151
if (forwardScroll !== isForwardScroll) setIsForwardScroll(forwardScroll);
5252
});
5353
}, [isForwardScroll, scrollY]);
5454

55-
const Bar = React.useCallback(
55+
const Bar = useCallback(
5656
() => (
5757
<Wrapper
5858
as="header"
@@ -91,7 +91,7 @@ const HeaderMobile = () => {
9191
[extendedState, isForwardScroll, t, toggleExtendedState]
9292
);
9393

94-
const Extended = React.useCallback(
94+
const Extended = useCallback(
9595
() => (
9696
<Wrapper
9797
as="header"

components/Layout/HeaderSwitcher.tsx

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import dynamic from "next/dynamic";
2-
import React from "react";
2+
import { useEffect, useState } from "react";
33

44
import { useBreakpointValue } from "@chakra-ui/media-query";
55

6-
const HeaderDesktop = dynamic(() => import("@components/Layout/HeaderDesktop"));
7-
const HeaderMobile = dynamic(() => import("@components/Layout/HeaderMobile"));
6+
const HeaderDesktop = dynamic(
7+
() => import("@/components/Layout/HeaderDesktop")
8+
);
9+
const HeaderMobile = dynamic(() => import("@/components/Layout/HeaderMobile"));
810

911
const HeaderSwitcher = () => {
1012
const mobileHeader = useBreakpointValue({ base: true, xl: false });
11-
const [header, setHeader] = React.useState(<HeaderMobile />);
13+
const [header, setHeader] = useState(<HeaderMobile />);
1214

13-
React.useEffect(() => {
15+
useEffect(() => {
1416
mobileHeader && setHeader(<HeaderMobile />);
1517
!mobileHeader && setHeader(<HeaderDesktop />);
1618
}, [mobileHeader]);

components/Layout/LanguageSwitcher.tsx

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { useTranslation } from "next-i18next";
22
import NextLink from "next/link";
33
import { useRouter } from "next/router";
4+
import { Key } from "react";
45

6+
import {
7+
ContextTranslationProps,
8+
useContentTranslationsContext,
9+
} from "@/hooks/ContentTranslationsContext";
510
import { Flex, Link, Text } from "@chakra-ui/layout";
611
import { ChakraComponent } from "@chakra-ui/system";
7-
import { useContentTranslationsContext } from "@hooks/ContentTranslationsContext";
8-
9-
import type { ContextTranslationProps } from "@hooks/ContentTranslationsContext";
1012

1113
type LanguageSwitcherProps = ChakraComponent<
1214
"div",
@@ -34,7 +36,7 @@ const LanguageSwitcher = (({ size, color, ...props }) => {
3436
const NextjsMode = () => (
3537
<>
3638
{locales &&
37-
locales.map((locale, key: React.Key) => (
39+
locales.map((locale, key: Key) => (
3840
<SwitcherLink key={key} locale={locale} href={asPath} />
3941
))}
4042
</>
@@ -43,7 +45,7 @@ const LanguageSwitcher = (({ size, color, ...props }) => {
4345
const DrupalMode = () => (
4446
<>
4547
{locales &&
46-
locales.map((locale, key: React.Key) => {
48+
locales.map((locale, key: Key) => {
4749
const translationForLocale = contentTranslationsContextState?.filter(
4850
(translation: ContextTranslationProps) => {
4951
return translation.langcode === locale;

components/Layout/Layout.tsx

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
import dynamic from "next/dynamic";
2-
import React from "react";
2+
import { ReactNode } from "react";
33

44
import { Box, Flex } from "@chakra-ui/layout";
55

66
const HeaderSwitcher = dynamic(
7-
() => import("@components/Layout/HeaderSwitcher")
7+
() => import("@/components/Layout/HeaderSwitcher")
88
);
9-
const Footer = dynamic(() => import("@components/Layout/Footer"));
10-
11-
const Layout = ({ children }: { children: React.ReactNode }) => {
12-
// const theme = useTheme();
13-
// console.log("theme :>> ", theme);
9+
const Footer = dynamic(() => import("@/components/Layout/Footer"));
1410

11+
const Layout = ({ children }: { children: ReactNode }) => {
1512
return (
1613
<>
1714
<Flex

0 commit comments

Comments
 (0)