Skip to content

Commit 032216d

Browse files
committed
feat(layout): Added cookie consent component to root layout
1 parent b4c3f11 commit 032216d

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

package-lock.json

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"luxon": "^3.5.0",
3030
"next": "15.2.0",
3131
"react": "^19.0.0",
32+
"react-cookie-consent": "^9.0.0",
3233
"react-dom": "^19.0.0",
3334
"react-icons": "^5.5.0",
3435
"react-markdown": "^10.1.0",

src/app/layout.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import "@/style/main.css"
66
import {ColorSchemeScript, mantineHtmlProps, MantineProvider} from '@mantine/core';
77
import React from "react";
88
import {Notifications} from "@mantine/notifications";
9+
import {CookieConsent} from "react-cookie-consent";
910

1011

1112
export default function RootLayout(props: { children: React.ReactNode }) {
@@ -30,6 +31,16 @@ export default function RootLayout(props: { children: React.ReactNode }) {
3031
}}/>
3132
{props.children}
3233
</MantineProvider>
34+
<CookieConsent
35+
location="bottom"
36+
buttonText="I already know"
37+
cookieName="AllowCookie"
38+
style={{ background: "#f54d04" }}
39+
buttonStyle={{ color: "#4e503b", fontSize: "13px" }}
40+
expires={150}
41+
>
42+
This website uses cookies to enhance the user experience.{" "}
43+
</CookieConsent>
3344
</body>
3445
</html>
3546
);

0 commit comments

Comments
 (0)