Skip to content

Commit

Permalink
deps: dependency upgrade for mantine (#16)
Browse files Browse the repository at this point in the history
* setup: upgraded mantine

* deps: updated Privacy to M7

* deps: Footer to M7

* deps: Home to M7

* deps: Locators tab to M7

* setup: intellisense for postcss

* deps: ColorSchemeToggler to M7

* deps: Header to M7

* deps: ColorPickerElement to M7

* deps: RequiresInstallation to M7

* deps: TraitsBuilderTab to M7

* deps: UnusedDDSFinder to M7

* fix: fixed increased space in header

* test: validated light locators page

* fix: fixed other tools page links being small

* fix: fixed privacy page links being small

* test: validated trait builder page

* test: validated unused dds finder page

* test: trigger e2e visual test generation for linux

* test: added linux visual tests
  • Loading branch information
The24thDS authored Jul 26, 2024
1 parent 7937352 commit afee7e3
Show file tree
Hide file tree
Showing 62 changed files with 475 additions and 478 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dev-dist
# Editor directories and files
.vscode/*
!.vscode/extensions.json
!.vscode/settings.json
.idea
.DS_Store
*.suo
Expand Down
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"vunguyentuan.vscode-css-variables",
"vunguyentuan.vscode-postcss"
]
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"cssVariables.lookupFiles": [
"**/*.css",
"**/*.scss",
"**/*.sass",
"**/*.less",
"node_modules/@mantine/core/styles.css",
"node_modules/@mantine/notification/styles.css",
"node_modules/@mantine/dropzone/styles.css"
]
}
Binary file modified e2e/home.spec.ts-snapshots/visual-test-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/home.spec.ts-snapshots/visual-test-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/home.spec.ts-snapshots/visual-test-1-firefox-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/home.spec.ts-snapshots/visual-test-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/home.spec.ts-snapshots/visual-test-1-webkit-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/home.spec.ts-snapshots/visual-test-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/privacy.spec.ts-snapshots/visual-test-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/privacy.spec.ts-snapshots/visual-test-1-firefox-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/privacy.spec.ts-snapshots/visual-test-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/privacy.spec.ts-snapshots/visual-test-1-webkit-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/privacy.spec.ts-snapshots/visual-test-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
},
"dependencies": {
"@emotion/react": "^11.9.3",
"@mantine/core": "^6.0.0",
"@mantine/dropzone": "^6.0.0",
"@mantine/hooks": "^6.0.0",
"@mantine/notifications": "^6.0.0",
"@mantine/core": "^7.0.0",
"@mantine/dropzone": "^7.0.0",
"@mantine/hooks": "^7.0.0",
"@mantine/notifications": "^7.0.0",
"@netlify/functions": "^1.0.0",
"@sentry/browser": "^7.12.1",
"@tabler/icons-react": "^3.5.0",
Expand All @@ -40,6 +40,9 @@
"@types/react-dom": "^18.3.0",
"@types/wicg-file-system-access": "^2023.10.5",
"@vitejs/plugin-react": "^4.2.1",
"postcss": "^8.4.38",
"postcss-preset-mantine": "^1.15.0",
"postcss-simple-vars": "^7.0.1",
"typescript": "^5.4.5",
"vite": "^5.2.11",
"vite-plugin-pwa": "^0.20.0",
Expand Down
14 changes: 14 additions & 0 deletions postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
plugins: {
"postcss-preset-mantine": {},
"postcss-simple-vars": {
variables: {
"mantine-breakpoint-xs": "36em",
"mantine-breakpoint-sm": "48em",
"mantine-breakpoint-md": "62em",
"mantine-breakpoint-lg": "75em",
"mantine-breakpoint-xl": "88em",
},
},
},
};
143 changes: 67 additions & 76 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { lazy, Suspense, useEffect } from "react";
import {
Center,
ColorScheme,
ColorSchemeProvider,
Container,
Loader,
MantineProvider,
Expand All @@ -10,10 +9,14 @@ import {
import { Notifications } from "@mantine/notifications";
import Header from "./components/Header/Header";
import { BrowserRouter, Route, Routes } from "react-router-dom";

import "@mantine/core/styles.css";
import "@mantine/notifications/styles.css";
import "@mantine/dropzone/styles.css";

import { ROUTES } from "./constants";
import Home from "./components/Home";
import LightLocatorsGeneratorTab from "./components/LightLocatorsGeneratorTab";
import { lazy, Suspense, useEffect, useState } from "react";
import Footer from "./components/Footer";
import Privacy from "./static_pages/Privacy";
import { isDNTEnabled } from "./utils/general";
Expand All @@ -28,9 +31,6 @@ const UnusedDDSFinderTab = lazy(() => import("./components/UnusedDDSFinder"));

export default function App() {
const beforeInstallPromptContextValue = useBeforeInstallPrompt();
const [colorScheme, setColorScheme] = useState<ColorScheme>("dark");
const toggleColorScheme = (value?: ColorScheme) =>
setColorScheme(value || (colorScheme === "dark" ? "light" : "dark"));

// Analytics script for prod
useEffect(() => {
Expand All @@ -56,78 +56,69 @@ export default function App() {
<BeforeInstallPromptContext.Provider
value={beforeInstallPromptContextValue}
>
<ColorSchemeProvider
colorScheme={colorScheme}
toggleColorScheme={toggleColorScheme}
>
<MantineProvider
theme={{ colorScheme }}
withGlobalStyles
withNormalizeCSS
>
<Notifications />
<BrowserRouter>
<Stack
sx={{
minHeight: "100vh",
<MantineProvider defaultColorScheme="dark">
<Notifications />
<BrowserRouter>
<Stack
style={{
minHeight: "100vh",
}}
>
<Header />
<Container
fluid
mt="md"
p="sm"
style={{
maxWidth: "1200px",
width: "100%",
}}
>
<Header />
<Container
fluid
mt="md"
p="sm"
sx={{
maxWidth: "1200px",
width: "100%",
}}
>
<Routes>
<Route path={ROUTES.HOME.path} element={<Home />} />
<Route
path={ROUTES.LIGHT_LOCATORS_GENERATOR.path}
element={<LightLocatorsGeneratorTab />}
/>
<Route
path={ROUTES.TRAITS_BUILDER.path}
element={
<Suspense
fallback={
<Center style={{ height: "300px" }}>
<Loader size="xl" variant="bars" />
</Center>
}
>
<TraitsBuilderTab />
</Suspense>
}
/>
<Route
path={ROUTES.UNUSED_DDS_FINDER.path}
element={
<Suspense
fallback={
<Center style={{ height: "300px" }}>
<Loader size="xl" variant="bars" />
</Center>
}
>
<UnusedDDSFinderTab />
</Suspense>
}
/>
<Route path={ROUTES.PRIVACY.path} element={<Privacy />} />
<Route
path={ROUTES.OTHER_TOOLS.path}
element={<OtherTools />}
/>
</Routes>
</Container>
<Footer />
</Stack>
</BrowserRouter>
</MantineProvider>
</ColorSchemeProvider>
<Routes>
<Route path={ROUTES.HOME.path} element={<Home />} />
<Route
path={ROUTES.LIGHT_LOCATORS_GENERATOR.path}
element={<LightLocatorsGeneratorTab />}
/>
<Route
path={ROUTES.TRAITS_BUILDER.path}
element={
<Suspense
fallback={
<Center style={{ height: "300px" }}>
<Loader size="xl" variant="bars" />
</Center>
}
>
<TraitsBuilderTab />
</Suspense>
}
/>
<Route
path={ROUTES.UNUSED_DDS_FINDER.path}
element={
<Suspense
fallback={
<Center style={{ height: "300px" }}>
<Loader size="xl" variant="bars" />
</Center>
}
>
<UnusedDDSFinderTab />
</Suspense>
}
/>
<Route path={ROUTES.PRIVACY.path} element={<Privacy />} />
<Route
path={ROUTES.OTHER_TOOLS.path}
element={<OtherTools />}
/>
</Routes>
</Container>
<Footer />
</Stack>
</BrowserRouter>
</MantineProvider>
</BeforeInstallPromptContext.Provider>
);
}
3 changes: 3 additions & 0 deletions src/components/Footer.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.link {
color: light-dark(var(--mantine-color-dark-5), var(--mantine-color-dark-0));
}
24 changes: 13 additions & 11 deletions src/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
import { Anchor, CSSObject, Group, MantineTheme, Text } from "@mantine/core";
import { Anchor, Group, Text } from "@mantine/core";
import { Link } from "react-router-dom";

import { ROUTES } from "../constants";

const footerLinkStyles = (theme: MantineTheme): CSSObject => ({
color:
theme.colorScheme === "light" ? theme.colors.dark[5] : theme.colors.dark[0],
});
import classes from "./Footer.module.css";

export default function Footer() {
return (
<Group position="apart" mt="auto" p="sm">
<Group justify="space-between" mt="auto" p="sm">
<Group>
<Text size="sm" color="dimmed">
<Text size="sm" c="dimmed">
&copy; {new Date().getFullYear()} Renegades Modding Group
</Text>
&bull;
<Anchor sx={footerLinkStyles} component={Link} to={ROUTES.PRIVACY.path}>
<Anchor
className={classes.link}
component={Link}
to={ROUTES.PRIVACY.path}
>
{ROUTES.PRIVACY.name}
</Anchor>
&bull;
<Anchor
sx={footerLinkStyles}
className={classes.link}
href="https://steamcommunity.com/workshop/filedetails/?id=2469745470"
target="_blank"
>
RMG's mods collection
</Anchor>
&bull;
<Anchor
sx={footerLinkStyles}
className={classes.link}
href="https://discord.gg/4xfQ78sPpm"
target="_blank"
>
Expand All @@ -37,7 +39,7 @@ export default function Footer() {
</Group>
<Anchor
size="sm"
color={"dimmed"}
c="dimmed"
href={`https://github.com/The24thDS/rmg-utils/releases/tag/v${APP_VERSION}`}
target="_blank"
rel="noopener noreferrer"
Expand Down
9 changes: 9 additions & 0 deletions src/components/Header/ColorSchemeToggle.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.icon {
background-color: var(--mantine-color-gray-0);
color: var(--mantine-color-blue-6);

@mixin dark {
background-color: var(--mantine-color-dark-6);
color: var(--mantine-color-yellow-4);
}
}
15 changes: 4 additions & 11 deletions src/components/Header/ColorSchemeToggle.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
import { useMantineColorScheme, ActionIcon, Group } from "@mantine/core";
import { IconSun, IconMoonStars } from "@tabler/icons-react";

import classes from "./ColorSchemeToggle.module.css";

export default function ColorSchemeTogle() {
const { colorScheme, toggleColorScheme } = useMantineColorScheme();

return (
<Group position="center" my="xl">
<Group justify="center" my="24px">
<ActionIcon
onClick={() => toggleColorScheme()}
size="lg"
sx={(theme) => ({
backgroundColor:
theme.colorScheme === "dark"
? theme.colors.dark[6]
: theme.colors.gray[0],
color:
theme.colorScheme === "dark"
? theme.colors.yellow[4]
: theme.colors.blue[6],
})}
className={classes.icon}
>
{colorScheme === "dark" ? (
<IconSun size={18} />
Expand Down
11 changes: 11 additions & 0 deletions src/components/Header/Header.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.header {
padding-top: var(--mantine-spacing-sm);
background-color: light-dark(
var(--mantine-color-gray-0),
var(--mantine-color-dark-6)
);
box-shadow: 0 -2px light-dark(
var(--mantine-color-gray-3),
var(--mantine-color-dark-4)
) inset;
}
Loading

0 comments on commit afee7e3

Please sign in to comment.