Skip to content

Commit 4f517b7

Browse files
committed
refactor: make assets local
1 parent 984972b commit 4f517b7

File tree

11 files changed

+106
-432
lines changed

11 files changed

+106
-432
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ Notable scripts:
5151

5252
See `package.json` for all available scripts.
5353

54+
### Assets
55+
The `/assets` folder is a Git subtree. Manage this with the following commands.
56+
```bash
57+
# Add the subtree
58+
git subtree add --prefix assets [email protected]:InformaticsMatters/squonk-assets.git main --squash
59+
60+
# Update the subtree when needed
61+
git subtree pull --prefix assets [email protected]:InformaticsMatters/squonk-assets.git main --squash
62+
```
63+
5464
## Testing
5565

5666
This project uses [Playwright](https://playwright.dev/) for integration and e2e testing. To get this setup install all dependencies:

next.config.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,6 @@ let nextConfig: NextConfig = {
3838
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
3939
basePath: process.env.NEXT_PUBLIC_BASE_PATH || undefined,
4040
transpilePackages: MONOREPO_MODE ? ["@squonk/mui-theme", "@squonk/sdf-parser"] : [],
41-
sassOptions: {
42-
silenceDeprecations: ["legacy-js-api"],
43-
prependData: `$assetsURL: "${process.env.ASSET_URL ?? "https://squonk.informaticsmatters.org"}";`,
44-
},
45-
images: {
46-
domains: ["squonk.informaticsmatters.org"],
47-
},
4841
// Allow mdx content and mdx files as pages
4942
webpack(config, options) {
5043
if (options.isServer) {

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@
9595
"react-dropzone": "14.3.5",
9696
"react-hook-form": "7.54.2",
9797
"react-plotly.js": "2.6.0",
98-
"sass": "1.83.1",
9998
"sharp": "0.33.5",
10099
"typescript": "5.7.2",
101100
"use-immer": "0.7.0",

pnpm-lock.yaml

Lines changed: 68 additions & 370 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/logo/LogoImage.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import Image from "next/image";
22

3+
import logo from "../../../assets/graphics/app-logos/data-manager.svg";
4+
import logoWhite from "../../../assets/graphics/app-logos/data-manager-white-tear-variant.svg";
35
import { useColorScheme } from "../../state/colorScheme";
46

57
export interface LogoImageProps {
@@ -8,8 +10,6 @@ export interface LogoImageProps {
810

911
const alt = "Squonk (animal) logo with title text 'Squonk' and subtitle 'Data Manager'";
1012

11-
const basePath = process.env.NEXT_PUBLIC_BASE_PATH ?? "";
12-
1313
export const LogoImage = ({ variant }: LogoImageProps) => {
1414
const [scheme] = useColorScheme();
1515

@@ -18,14 +18,8 @@ export const LogoImage = ({ variant }: LogoImageProps) => {
1818
}
1919

2020
return variant === "dark" ? (
21-
<Image
22-
priority
23-
alt={alt}
24-
height="60"
25-
src={basePath + "/DataManager_WhiteOpt2.svg"}
26-
width="206"
27-
/>
21+
<Image priority alt={alt} height="60" src={logoWhite} width="206" />
2822
) : (
29-
<Image priority alt={alt} height="60" src={basePath + "/DataManager.svg"} width="206" />
23+
<Image priority alt={alt} height="60" src={logo} width="206" />
3024
);
3125
};

src/constants/fonts.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Fira_Mono as firaMono, Open_Sans as openSans } from "next/font/google";
2+
import localFont from "next/font/local";
23

34
export const openSansFont = openSans({
45
weight: "variable",
@@ -11,3 +12,20 @@ export const firaMonoFont = firaMono({
1112
weight: "400",
1213
subsets: ["latin"],
1314
});
15+
16+
export const ralewayFont = localFont({
17+
src: [
18+
{
19+
path: "../../assets/fonts/Raleway/Raleway-Regular.woff2",
20+
style: "normal",
21+
},
22+
{
23+
path: "../../assets/fonts/Raleway/Raleway-Italic.woff2",
24+
style: "italic",
25+
},
26+
{
27+
path: "../../assets/fonts/Raleway/Raleway-Bold.woff2",
28+
weight: "700",
29+
},
30+
],
31+
});

src/layouts/Footer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
import A from "next/link";
1313

1414
import { AppVersions } from "../components/AppVersions";
15+
import { ralewayFont } from "../constants/fonts";
1516

1617
export const Footer = () => {
1718
const small = useMediaQuery((theme: Theme) => theme.breakpoints.up("sm"));
@@ -23,7 +24,7 @@ export const Footer = () => {
2324
<Grid container sx={{ p: 2 }}>
2425
<Grid size={{ sm: 6, xs: 12 }}>
2526
<Typography variant="h4">
26-
<strong style={{ fontFamily: "Raleway" }}>
27+
<strong style={{ fontFamily: ralewayFont.style.fontFamily }}>
2728
<Link href="https://squonk.it/" rel="noopener noreferrer" target="_blank">
2829
Squonk
2930
</Link>

src/pages/_app.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@ import { openSansFont } from "../constants/fonts";
2121
import { AS_API_URL, DM_API_URL } from "../constants/proxies";
2222
import { MDXComponentProvider } from "../context/MDXComponentProvider";
2323

24-
import "../styles/globalStyles.scss";
25-
2624
const openSansFontCss = `
27-
html {
25+
:root {
2826
font-family: ${openSansFont.style.fontFamily};
27+
font-size: 14px;
2928
}
3029
`;
3130

src/pages/project.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Box, Container, Grid2 as Grid, Typography } from "@mui/material";
33
import Head from "next/head";
44
import Image from "next/image";
55

6+
import sadderSquonk from "../../assets/graphics/sadder-squonk.svg";
67
import { RoleRequired } from "../components/auth/RoleRequired";
78
import { ProjectSelection } from "../components/projects/ProjectSelection";
89
import { SelectProject } from "../components/userContext/SelectProject";
@@ -69,7 +70,7 @@ const Project = () => {
6970
<Image
7071
alt="Squonk in tears that you haven't selected a project"
7172
height={150}
72-
src="https://squonk.informaticsmatters.org/assets/sadderSquonk.svg"
73+
src={sadderSquonk}
7374
width={150}
7475
/>
7576
<Box sx={{ marginY: 1 }}>

src/styles/globalStyles.scss

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

0 commit comments

Comments
 (0)