From 94602aa4e055738710668feb78b3b9dbeaace118 Mon Sep 17 00:00:00 2001 From: Jordan Roher Date: Fri, 21 Apr 2023 15:08:24 -0700 Subject: [PATCH] Added header line option --- docker-entrypoint.sh | 3 ++- dockerfile | 1 + readme.md | 1 + src/pages/index.tsx | 10 ++++++++-- src/variables.ts | 3 ++- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 62fd5ca..fe4e968 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -9,7 +9,8 @@ sed -i -e 's/HTMLTITLE/'"${TITLE}"'/g' /app/index.html # TypeScript replacement sed -i -e 's/(PAGETITLE = ")My Website(")/'"$1${TITLE}$2"'/g' /app/src/variables.ts sed -i -e 's/(PAGEICON = ")\/logo\.png(")/'"$1${LOGO}$2"'/g' /app/src/variables.ts -sed -i -e 's/(SHOWHEADER = )false/'"$1${HEADER}"'/g' /app/src/variables.ts +sed -i -e 's/(SHOWHEADER = )true/'"$1${HEADER}"'/g' /app/src/variables.ts +sed -i -e 's/(SHOWHEADERLINE = )true/'"$1${HEADERLINE}"'/g' /app/src/variables.ts sed -i -e 's/(CATEGORIES = ")normal(")/'"$1${CATEGORIES}$2"'/g' /app/src/variables.ts # CSS replacement diff --git a/dockerfile b/dockerfile index b031ff8..87e785e 100644 --- a/dockerfile +++ b/dockerfile @@ -12,6 +12,7 @@ ENV NODE_ENV production ENV TITLE "My Website" ENV LOGO "/logo.png" ENV HEADER "true" +ENV HEADERLINE "true" ENV CATEGORIES "normal" ENV BGCOLOR "#f8fafc" diff --git a/readme.md b/readme.md index 7ffe945..d74a7cd 100644 --- a/readme.md +++ b/readme.md @@ -86,6 +86,7 @@ services: - TITLE=Starbase 80 # defaults to "My Website", set to TITLE= to hide the title - LOGO=/starbase80.jpg # defaults to /logo.png, set to LOGO= to hide the logo - HEADER=true # defaults to true, set to false to hide the title and logo + - HEADERLINE=true # defaults to true, set to false to turn off the header border line - CATEGORIES=small # defaults to normal, set to small for smaller, uppercase category labels - BGCOLOR=#fff # defaults to #f8fafc, set to any hex color or Tailwind color using the theme syntax (e.g. BGCOLOR=theme(colors.sky.100) for bg-sky-100) volumes: diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 6ba7648..268a026 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -3,7 +3,7 @@ import { Header } from "../components/header"; import { ServiceCatalogs } from "../components/service-catalogs"; import userServices from "../config.json"; import { IServiceCatalog } from "../shared/types"; -import { SHOWHEADER } from "../variables"; +import { SHOWHEADER, SHOWHEADERLINE } from "../variables"; interface IProps { title?: string; @@ -13,10 +13,16 @@ interface IProps { export const IndexPage: React.FunctionComponent = ({ icon, title }) => { const mySerices = userServices as IServiceCatalog[]; + let headerClassName = "w-full xl:w-auto xl:max-w-xs xl:min-h-screen p-4"; + + if (SHOWHEADERLINE) { + headerClassName += "border-0 border-solid border-b xl:border-r xl:border-b-0 border-gray-300"; + } + return (
{SHOWHEADER && ( -
+
)} diff --git a/src/variables.ts b/src/variables.ts index 0783b5f..8557e50 100644 --- a/src/variables.ts +++ b/src/variables.ts @@ -1,4 +1,5 @@ export const PAGETITLE = "My Website"; export const PAGEICON = "/logo.png"; export const SHOWHEADER = true; -export const CATEGORIES = "normal"; +export const SHOWHEADERLINE = true; +export const CATEGORIES = "small";