Skip to content

Commit 38b1dd3

Browse files
authored
Merge pull request #15 from CodeDead/feature/upgrades
feat: removed google analytics, dependency upgrades, Yarn upgrade
2 parents 7c1d481 + 054731b commit 38b1dd3

File tree

14 files changed

+937
-1095
lines changed

14 files changed

+937
-1095
lines changed
Lines changed: 346 additions & 345 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
nodeLinker: node-modules
22

3-
yarnPath: .yarn/releases/yarn-4.6.0.cjs
3+
yarnPath: .yarn/releases/yarn-4.8.1.cjs

package.json

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,30 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13-
"@mantine/core": "^7.16.1",
14-
"@mantine/dropzone": "^7.16.1",
15-
"@mantine/hooks": "^7.16.1",
16-
"@mantine/notifications": "^7.16.1",
17-
"@tabler/icons-react": "^3.28.1",
13+
"@mantine/core": "^7.17.3",
14+
"@mantine/dropzone": "^7.17.3",
15+
"@mantine/hooks": "^7.17.3",
16+
"@mantine/notifications": "^7.17.3",
17+
"@tabler/icons-react": "^3.31.0",
1818
"compressorjs": "^1.2.1",
19-
"react": "^19.0.0",
20-
"react-dom": "^19.0.0",
21-
"react-ga4": "^2.1.0",
22-
"react-router-dom": "^7.1.3"
19+
"react": "^19.1.0",
20+
"react-dom": "^19.1.0",
21+
"react-router-dom": "^7.4.1"
2322
},
2423
"devDependencies": {
25-
"@eslint/compat": "^1.2.5",
26-
"@eslint/js": "^9.18.0",
27-
"@types/react": "^19.0.7",
28-
"@types/react-dom": "^19.0.3",
24+
"@eslint/compat": "^1.2.7",
25+
"@eslint/js": "^9.23.0",
26+
"@types/react": "^19.0.12",
27+
"@types/react-dom": "^19.0.4",
2928
"@vitejs/plugin-react": "^4.3.4",
30-
"eslint": "^9.18.0",
29+
"eslint": "^9.23.0",
3130
"eslint-plugin-react": "^7.37.4",
32-
"globals": "^15.14.0",
33-
"postcss": "^8.5.1",
31+
"globals": "^16.0.0",
32+
"postcss": "^8.5.3",
3433
"postcss-preset-mantine": "^1.17.0",
3534
"postcss-simple-vars": "^7.0.1",
36-
"prettier": "^3.4.2",
37-
"vite": "^6.0.9"
35+
"prettier": "^3.5.3",
36+
"vite": "^6.2.3"
3837
},
39-
"packageManager": "yarn@4.6.0"
38+
"packageManager": "yarn@4.8.1"
4039
}

src/components/App/index.jsx

Lines changed: 4 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,28 @@
1-
import React, { useEffect, useContext, Suspense, lazy, useState } from "react";
1+
import React, { useEffect, useContext, Suspense, lazy } from "react";
22
import HeaderBar from "../HeaderBar";
33
import { Center, Loader, useMantineColorScheme } from "@mantine/core";
44
import { AppShell } from "@mantine/core";
55
import { BrowserRouter, Routes, Route } from "react-router-dom";
66
import Footer from "../Footer/index.jsx";
77
import { MainContext } from "../../context/MainContextProvider";
8-
import ReactGA from "react-ga4";
9-
import { setAllowCookies } from "../../reducer/MainReducer/Actions/index.js";
10-
import CookieNotice from "../CookieNotice/index.jsx";
118

129
const Home = lazy(() => import("../../routes/Home"));
1310
const About = lazy(() => import("../../routes/About"));
1411
const NotFound = lazy(() => import("../../routes/NotFound"));
1512

1613
const App = () => {
17-
const [state, d1] = useContext(MainContext);
14+
const [state] = useContext(MainContext);
1815
const { setColorScheme } = useMantineColorScheme();
1916

20-
const { themeType, allowCookies, hasSetCookies } = state;
21-
22-
const [cookieBannerOpen, setCookieBannerOpen] = useState(!hasSetCookies);
23-
24-
/**
25-
* Close the cookie banner
26-
*/
27-
const closeCookieBanner = () => {
28-
setCookieBannerOpen(false);
29-
};
30-
31-
/**
32-
* Accept cookies
33-
*/
34-
const acceptCookies = () => {
35-
d1(setAllowCookies(true));
36-
setCookieBannerOpen(false);
37-
};
38-
39-
/**
40-
* Decline cookies
41-
*/
42-
const declineCookies = () => {
43-
d1(setAllowCookies(false));
44-
setCookieBannerOpen(false);
45-
};
17+
const { themeType } = state;
4618

4719
useEffect(() => {
4820
setColorScheme(themeType);
4921
}, []);
5022

51-
useEffect(() => {
52-
if (allowCookies) {
53-
ReactGA.initialize("G-YQZGPHN1BH");
54-
window["ga-disable-G-YQZGPHN1BH"] = false;
55-
} else {
56-
window["ga-disable-G-YQZGPHN1BH"] = true;
57-
}
58-
}, [allowCookies]);
59-
6023
return (
6124
<BrowserRouter>
62-
<AppShell
63-
header={{ height: 60 }}
64-
footer={{ height: 115 }}
65-
padding="md"
66-
>
25+
<AppShell header={{ height: 60 }} footer={{ height: 115 }} padding="md">
6726
<AppShell.Header>
6827
<HeaderBar />
6928
</AppShell.Header>
@@ -82,13 +41,6 @@ const App = () => {
8241
</Routes>
8342
</Suspense>
8443
</AppShell.Main>
85-
{cookieBannerOpen ? (
86-
<CookieNotice
87-
onAccept={acceptCookies}
88-
onDecline={declineCookies}
89-
onClose={closeCookieBanner}
90-
/>
91-
) : null}
9244
<AppShell.Footer>
9345
<Footer />
9446
</AppShell.Footer>

src/components/CookieNotice/index.jsx

Lines changed: 0 additions & 66 deletions
This file was deleted.

src/components/DropzoneButton/index.jsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
import React, { useRef } from "react";
2-
import {
3-
Text,
4-
Group,
5-
Button,
6-
useMantineTheme,
7-
Popover,
8-
} from "@mantine/core";
2+
import { Text, Group, Button, useMantineTheme, Popover } from "@mantine/core";
93
import { Dropzone, MIME_TYPES } from "@mantine/dropzone";
104
import { IconCloudUpload, IconX, IconDownload } from "@tabler/icons-react";
115
import classes from "./dropzonebutton.module.css";
@@ -35,7 +29,11 @@ const DropzoneButton = ({ popOverOpen, setPopOverOpen, changeFiles }) => {
3529
<div style={{ pointerEvents: "none" }}>
3630
<Group justify="center">
3731
<Dropzone.Accept>
38-
<IconDownload size={50} color={theme.colors.blue[6]} stroke={1.5} />
32+
<IconDownload
33+
size={50}
34+
color={theme.colors.blue[6]}
35+
stroke={1.5}
36+
/>
3937
</Dropzone.Accept>
4038
<Dropzone.Reject>
4139
<IconX size={50} color={theme.colors.red[6]} stroke={1.5} />

src/context/MainContextProvider/index.jsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,10 @@ import { createContext, useReducer } from "react";
33
import MainReducer from "../../reducer/MainReducer/index.jsx";
44

55
const themeType = localStorage.themeType ? localStorage.themeType : "auto";
6-
let hasSetCookies = false;
7-
let allowCookies = true;
8-
9-
if (localStorage.allowCookies) {
10-
allowCookies = localStorage.allowCookies === "true";
11-
hasSetCookies = true;
12-
}
136

147
const initialState = {
158
pageIndex: 0,
169
themeType,
17-
allowCookies,
18-
hasSetCookies,
1910
};
2011

2112
export const MainContext = createContext(initialState);
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
export const SET_PAGE_INDEX = "SET_PAGE_INDEX";
22
export const SET_THEME_TYPE = "SET_THEME_TYPE";
3-
export const SET_ALLOW_COOKIES = "SET_ALLOW_COOKIES";
Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import {
2-
SET_ALLOW_COOKIES,
3-
SET_PAGE_INDEX,
4-
SET_THEME_TYPE,
5-
} from "./ActionTypes/index.js";
1+
import { SET_PAGE_INDEX, SET_THEME_TYPE } from "./ActionTypes/index.js";
62

73
export const setPageIndex = (index) => ({
84
type: SET_PAGE_INDEX,
@@ -13,8 +9,3 @@ export const setThemeType = (type) => ({
139
type: SET_THEME_TYPE,
1410
payload: type,
1511
});
16-
17-
export const setAllowCookies = (allow) => ({
18-
type: SET_ALLOW_COOKIES,
19-
payload: allow,
20-
});

src/reducer/MainReducer/index.jsx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import {
2-
SET_ALLOW_COOKIES,
3-
SET_PAGE_INDEX,
4-
SET_THEME_TYPE,
5-
} from "./Actions/ActionTypes/index.js";
1+
import { SET_PAGE_INDEX, SET_THEME_TYPE } from "./Actions/ActionTypes/index.js";
62

73
const MainReducer = (state, action) => {
84
switch (action.type) {
@@ -17,12 +13,6 @@ const MainReducer = (state, action) => {
1713
...state,
1814
themeType: action.payload,
1915
};
20-
case SET_ALLOW_COOKIES:
21-
localStorage.allowCookies = action.payload;
22-
return {
23-
...state,
24-
allowCookies: action.payload,
25-
};
2616
default:
2717
throw new Error();
2818
}

0 commit comments

Comments
 (0)