From fb42862de331abb99a70bbc7ccb5443b02caa4ed Mon Sep 17 00:00:00 2001 From: SebiVPS <42858722+SebiVPS@users.noreply.github.com> Date: Tue, 3 Dec 2024 14:14:33 +0100 Subject: [PATCH 1/3] Make header logo touchable and link to home page (#579) Feedback from first project: The logo should be touchable and link to the home page. Nearly every homepage has this behavior so i think we can also add it to the starter. --- site/src/layout/header/Header.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/site/src/layout/header/Header.tsx b/site/src/layout/header/Header.tsx index cf7d4ccf7..b10135a01 100644 --- a/site/src/layout/header/Header.tsx +++ b/site/src/layout/header/Header.tsx @@ -3,6 +3,7 @@ import { SvgUse } from "@src/common/helpers/SvgUse"; import { MobileMenu } from "@src/layout/header/MobileMenu"; import { PageLink } from "@src/layout/header/PageLink"; import { PageLayout } from "@src/layout/PageLayout"; +import Link from "next/link"; import { useEffect, useState } from "react"; import { useIntl } from "react-intl"; import styled from "styled-components"; @@ -43,7 +44,9 @@ export const Header = ({ header }: Props) => { - + + + @@ -56,9 +59,9 @@ export const Header = ({ header }: Props) => { onMouseLeave={() => setExpandedSubLevelNavigation(null)} > - + {node.name} - + {visibleChildNodes.length > 0 && ( { {visibleChildNodes.map((node) => (
  • - + {node.name} - +
  • ))}
    @@ -185,7 +188,7 @@ const AnimatedChevron = styled(SvgUse)<{ $isExpanded: boolean }>` transition: transform 0.4s ease; `; -const Link = styled(PageLink)` +const MenuPageLink = styled(PageLink)` text-decoration: none; display: inline-block; padding: ${({ theme }) => theme.spacing.S100} 0; From 5bf5820ce48fcfc48d11d67952c73d677c27f422 Mon Sep 17 00:00:00 2001 From: Franz Unger Date: Tue, 3 Dec 2024 15:59:27 +0100 Subject: [PATCH 2/3] Add basic notfound page (#575) --- site/src/app/[domain]/[language]/not-found.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 site/src/app/[domain]/[language]/not-found.tsx diff --git a/site/src/app/[domain]/[language]/not-found.tsx b/site/src/app/[domain]/[language]/not-found.tsx new file mode 100644 index 000000000..89b9ad758 --- /dev/null +++ b/site/src/app/[domain]/[language]/not-found.tsx @@ -0,0 +1,12 @@ +import Link from "next/link"; + +export default async function NotFound404() { + return ( + + +

    Page not found.

    + Return Home + + + ); +} From b02527349d90e668c5185f90a5def113bd842fa3 Mon Sep 17 00:00:00 2001 From: Daniel Karnutsch Date: Wed, 4 Dec 2024 13:06:26 +0100 Subject: [PATCH 3/3] Use consistent root for serving admin --- admin/server/{server.js => index.js} | 6 +++--- admin/server/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) rename admin/server/{server.js => index.js} (93%) diff --git a/admin/server/server.js b/admin/server/index.js similarity index 93% rename from admin/server/server.js rename to admin/server/index.js index 18e1644ce..078022de5 100644 --- a/admin/server/server.js +++ b/admin/server/index.js @@ -3,12 +3,12 @@ const express = require("express"); const compression = require("compression"); const helmet = require("helmet"); const fs = require("fs"); +const path = require("path"); const app = express(); const port = process.env.APP_PORT ?? 3000; -// Read index.html file -let indexFile = fs.readFileSync("../build/index.html", "utf8"); +let indexFile = fs.readFileSync(path.join(__dirname, "../build/index.html"), "utf8"); // Replace environment variables indexFile = indexFile.replace(/\$([A-Z_]+)/g, (match, p1) => { @@ -42,7 +42,7 @@ app.get("/status/health", (req, res) => { }); app.use( - express.static("../build", { + express.static(path.join(__dirname, "../build"), { index: false, // Don't send index.html for requests to "/" as it will be handled by the fallback route (with replaced environment variables) setHeaders: (res, path, stat) => { if (path.endsWith(".js")) { diff --git a/admin/server/package.json b/admin/server/package.json index ee737cccf..637f7fae0 100644 --- a/admin/server/package.json +++ b/admin/server/package.json @@ -2,7 +2,7 @@ "name": "server", "private": true, "scripts": { - "serve": "node server.js" + "serve": "node index.js" }, "dependencies": { "compression": "^1.7.5",