Skip to content
Merged

Dev #21

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 3 additions & 44 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,48 +11,7 @@ jobs:
uses: actions/checkout@v2
- name: Install dependencies
run: npm ci
- name: Lint
- name: Lint code
run: npm run lint
# build:
# runs-on: ubuntu-latest
# needs: lint
# if : ${{ github.ref == 'refs/heads/main' }}
# steps:
# -
# name: Checkout
# uses: actions/checkout@v2
# -
# name: Docker Metadata
# id: meta
# uses: docker/metadata-action@v3
# with:
# images: ${{ secrets.DOCKER_REPOSITORY }}
# tags: |
# type=sha,enable=true,priority=100,prefix=,suffix=,format=short
# -
# name: Set up QEMU
# uses: docker/setup-qemu-action@v1
# -
# name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
# -
# name: Login to DockerHub
# if: github.event_name != 'pull_request'
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# -
# name: Build and push
# id: docker_build
# uses: docker/build-push-action@v2
# with:
# push: ${{ github.event_name != 'pull_request' }}
# tags: |
# ${{ steps.meta.outputs.tags }}
# ${{ secrets.DOCKER_REPOSITORY }}:latest
# build-args: |
# GIT_SHA=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
# PAYLOAD_URL=${{ vars.PAYLOAD_URL }}
# FRONTEND_URL=${{ vars.FRONTEND_URL }}
# TURNSTILE_SITE_KEY=${{ vars.TURNSTILE_SITE_KEY }}
- name: Check code style
run: npm run prettier
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ This project uses **Docker Hub Automated Builds** for continuous deployment:
- `main` branch → Production environment variables (`latest` tag)
- `dev` branch → Development environment variables (`latest-test` tag)
4. **Image Tagging**: The built image is tagged with the git commit hash and branch-specific tags:
- `main` → `seebruecke/bside-website:a1b2c3d` + `seebruecke/bside-website:latest`
- `dev` → `seebruecke/bside-website:b2c3d4e` + `seebruecke/bside-website:latest-test`
- `main` → `seebruecke/bside-website:a1b2c3d` + `seebruecke/bside-website:latest`
- `dev` → `seebruecke/bside-website:b2c3d4e` + `seebruecke/bside-website:latest-test`
5. **Registry Push**: The image is automatically pushed to Docker Hub
9 changes: 2 additions & 7 deletions components/blocks/buttonBlock/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@ interface Props {

const Button = ({ title, href, text, target = '_self', inverse = false }: Props): ReactElement => {
return (
<div
key={!isEmptyString(title) ? `cta-${toKebabCase(title)}` : `cta-${toKebabCase(text)}`}
className="mx-auto py-4 text-center"
>
{!isEmptyString(title) && (
<div className="mb-1 font-serif text-xl font-bold md:mb-3 md:text-2xl">{title}</div>
)}
<div key={!isEmptyString(title) ? `cta-${toKebabCase(title)}` : `cta-${toKebabCase(text)}`} className="mx-auto py-4 text-center">
{!isEmptyString(title) && <div className="mb-1 font-serif text-xl font-bold md:mb-3 md:text-2xl">{title}</div>}

<Link
href={href}
Expand Down
9 changes: 2 additions & 7 deletions components/blocks/buttonBlock/InlineButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,8 @@ interface Props {

const Button = ({ title, href, text, target = '_self' }: Props): ReactElement => {
return (
<span
key={!isEmptyString(title) ? `cta-${toKebabCase(title)}` : ''}
className="mx-auto py-4 text-center"
>
{!isEmptyString(title) && (
<div className="mb-1 font-serif text-xl font-bold md:mb-3 md:text-2xl">{title}</div>
)}
<span key={!isEmptyString(title) ? `cta-${toKebabCase(title)}` : ''} className="mx-auto py-4 text-center">
{!isEmptyString(title) && <div className="mb-1 font-serif text-xl font-bold md:mb-3 md:text-2xl">{title}</div>}

<Link
href={href}
Expand Down
9 changes: 2 additions & 7 deletions components/blocks/callToActionBlock/CallToAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,14 @@ const CallToAction = ({ title, href, text, withArrows = true }: Props): ReactEle
const key = !isEmptyString(title) ? `cta-${toKebabCase(title)}` : `cta-${toKebabCase(text)}`;

return (
<div
key={key}
className={`relative ${width} mx-auto border-4 border-black px-6 py-4 text-center`}
>
<div key={key} className={`relative ${width} mx-auto border-4 border-black px-6 py-4 text-center`}>
{withArrows && (
<div className="absolute right-[102%] top-1/2 w-4 -translate-y-1/2 md:w-6">
<Chevron />
</div>
)}

{!isEmptyString(title) && (
<div className="mb-1 font-serif text-xl font-bold md:mb-3 md:text-2xl">{title}</div>
)}
{!isEmptyString(title) && <div className="mb-1 font-serif text-xl font-bold md:mb-3 md:text-2xl">{title}</div>}

<Link
href={href}
Expand Down
6 changes: 1 addition & 5 deletions components/blocks/circleOverviewBlock/CircleOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ const CircleOverview = ({ headlineText, circles, richText }: Props): ReactElemen
<div className="group relative flex cursor-pointer items-center justify-between border-b border-gray-300 px-4 py-1">
<div className="z-10 transition-all duration-100 group-hover:text-black lg:text-lg">
<p className="font-serif">{circle.name}</p>
{!isEmptyString(circle.description) && (
<p className="text-sm lg:text-base">
{circle.description}
</p>
)}
{!isEmptyString(circle.description) && <p className="text-sm lg:text-base">{circle.description}</p>}
</div>
<div
className="absolute inset-0 opacity-0 transition-all duration-100 group-hover:opacity-100"
Expand Down
6 changes: 1 addition & 5 deletions components/blocks/eventOverviewBlock/EventsOverviewBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ interface EventOverviewBlockProps {
eventsOnPage?: EventsOnPage;
}

const EventsOverviewBlock = ({
headlineText,
richText,
eventsOnPage,
}: EventOverviewBlockProps): ReactElement => {
const EventsOverviewBlock = ({ headlineText, richText, eventsOnPage }: EventOverviewBlockProps): ReactElement => {
return (
<>
<ContentWrapper className="">
Expand Down
10 changes: 1 addition & 9 deletions components/blocks/headlineBlock/Headline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,7 @@ import HeadlineTag from '@blocks/headlineBlock/HeadlineTag';

export type HeadlineLevel = 'h1' | 'h2' | 'h3' | 'h4';

const Headline = ({
title,
anchor,
teaser,
level,
as = null,
teaserLink = '',
textClass = '',
}: HeadlineBlockProps): ReactElement => {
const Headline = ({ title, anchor, teaser, level, as = null, teaserLink = '', textClass = '' }: HeadlineBlockProps): ReactElement => {
const renderedLevel = as ?? level;

return (
Expand Down
16 changes: 2 additions & 14 deletions components/blocks/headlineBlock/HeadlineBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ const HeadlineBlock = (props: HeadlineBlockProps): ReactElement => {
<div className="grow">
<div className="bg-black text-white">
<ContentWrapper className="!-mb-2 !pb-0 pt-4">
<Headline
title={props.title}
anchor={props.anchor}
teaser={props.teaser}
level={props.level}
as={props.as}
/>
<Headline title={props.title} anchor={props.anchor} teaser={props.teaser} level={props.level} as={props.as} />
</ContentWrapper>
</div>
</div>
Expand All @@ -24,13 +18,7 @@ const HeadlineBlock = (props: HeadlineBlockProps): ReactElement => {

return (
<ContentWrapper className="!-mb-2 !pb-0 pt-4">
<Headline
title={props.title}
anchor={props.anchor}
teaser={props.teaser}
level={props.level}
as={props.as}
/>
<Headline title={props.title} anchor={props.anchor} teaser={props.teaser} level={props.level} as={props.as} />
</ContentWrapper>
);
};
Expand Down
10 changes: 2 additions & 8 deletions components/blocks/headlineBlock/HeadlineKicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,13 @@ const HeadlineKicker = ({ children, level, link = '' }: Props): ReactElement =>
switch (level) {
case 'h1':
return (
<small className="mb-1 block text-base font-normal italic leading-none tracking-normal md:text-base">
{linkContent}
</small>
<small className="mb-1 block text-base font-normal italic leading-none tracking-normal md:text-base">{linkContent}</small>
);

case 'h2':
case 'h3':
case 'h4':
return (
<small className="block text-base font-normal italic leading-none tracking-normal md:text-base">
{linkContent}
</small>
);
return <small className="block text-base font-normal italic leading-none tracking-normal md:text-base">{linkContent}</small>;
}
};

Expand Down
20 changes: 4 additions & 16 deletions components/blocks/headlineBlock/HeadlineTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,40 +21,28 @@ const HeadlineTag = ({ children, level, anchor }: Props): ReactElement => {
switch (level) {
case 'h1':
return (
<h1
id={id}
className="break-words font-serif text-3xl leading-none sm:break-normal md:scroll-mt-[96px] md:text-4xl"
>
<h1 id={id} className="break-words font-serif text-3xl leading-none sm:break-normal md:scroll-mt-[96px] md:text-4xl">
{children}
</h1>
);

case 'h2':
return (
<h2
id={id}
className="break-words font-serif text-2xl leading-tight sm:break-normal md:scroll-mt-[96px] md:text-3xl"
>
<h2 id={id} className="break-words font-serif text-2xl leading-tight sm:break-normal md:scroll-mt-[96px] md:text-3xl">
{children}
</h2>
);

case 'h3':
return (
<h3
id={id}
className="break-words font-serif text-xl leading-tight sm:break-normal md:scroll-mt-[96px] md:text-2xl"
>
<h3 id={id} className="break-words font-serif text-xl leading-tight sm:break-normal md:scroll-mt-[96px] md:text-2xl">
{children}
</h3>
);

case 'h4':
return (
<h4
id={id}
className="font-serif text-xl font-bold leading-tight md:scroll-mt-[96px] md:text-xl"
>
<h4 id={id} className="font-serif text-xl font-bold leading-tight md:scroll-mt-[96px] md:text-xl">
{children}
</h4>
);
Expand Down
12 changes: 2 additions & 10 deletions components/blocks/mediaBlock/MediaBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ import isEmptyString from '@/lib/common/helper/isEmptyString';
import isEmptyNumber from '@/lib/common/helper/isEmptyNumber';
import type { MediaBlockProps } from '@/types/payload/Blocks';

const WideMediaBlock = (
url: string,
effects: Array<'blur' | 'grayscale' | 'desaturated' | 'darker'>,
): ReactElement | null => {
const WideMediaBlock = (url: string, effects: Array<'blur' | 'grayscale' | 'desaturated' | 'darker'>): ReactElement | null => {
return (
<div className="w-full px-4 lg:mx-auto lg:w-[60rem] xl:w-[80rem]">
<div
Expand All @@ -28,12 +25,7 @@ const WideMediaBlock = (
);
};

const MediaBlock = ({
media,
caption,
size,
effects,
}: MediaBlockProps): ReactElement | null => {
const MediaBlock = ({ media, caption, size, effects }: MediaBlockProps): ReactElement | null => {
if (typeof media === 'string') {
console.warn('Unexpectedly media is just a string, this is not supported.');
return null;
Expand Down
25 changes: 3 additions & 22 deletions components/blocks/mediaContent/MediaContentBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,20 @@ const MediaContentBlock = ({
}

if (alignment === 'contentOnBottom') {
return (
<MediaContentOverlay
media={media}
richText={richText}
headlineText={headline ?? undefined}
effects={effects ?? []}
/>
);
return <MediaContentOverlay media={media} richText={richText} headlineText={headline ?? undefined} effects={effects ?? []} />;
}

if (backgroundColor === 'black') {
return (
<div className="grow">
<div className="bg-black text-white">
<MediaContent
media={media}
richText={richText}
alignment={alignment}
effects={effects ?? []}
/>
<MediaContent media={media} richText={richText} alignment={alignment} effects={effects ?? []} />
</div>
</div>
);
}

return (
<MediaContent
media={media}
richText={richText}
alignment={alignment}
effects={effects ?? []}
/>
);
return <MediaContent media={media} richText={richText} alignment={alignment} effects={effects ?? []} />;
};

export default MediaContentBlock;
19 changes: 2 additions & 17 deletions components/blocks/mediaContent/MediaContentOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,7 @@ interface Props {
effects: Array<'blur' | 'grayscale' | 'desaturated' | 'darker'>;
}

const MediaContentOverlay = ({
media,
richText,
headlineText,
headlineTeaser,
buttonText,
buttonHref,
effects,
}: Props): ReactElement => {
const MediaContentOverlay = ({ media, richText, headlineText, headlineTeaser, buttonText, buttonHref, effects }: Props): ReactElement => {
return (
<>
<div className="w-full p-4 lg:mx-auto lg:w-[60rem] xl:w-[80rem]">
Expand All @@ -45,14 +37,7 @@ const MediaContentOverlay = ({
<div className="-mb-24 -translate-y-20 px-4 md:-mb-20 md:-translate-y-20 md:px-0">
<ContentWrapper>
<div className="bg-black p-6 text-white">
{!isEmptyString(headlineText) && (
<Headline
title={headlineText}
teaser={headlineTeaser ?? ''}
level="h3"
as="h2"
/>
)}
{!isEmptyString(headlineText) && <Headline title={headlineText} teaser={headlineTeaser ?? ''} level="h3" as="h2" />}
<div className="mt-3 md:text-lg">
<RichText content={richText} />
</div>
Expand Down
6 changes: 1 addition & 5 deletions components/blocks/reusableLayout/ReusableBlockLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ const ReusableBlockLayout = ({ layout, circles, eventsOnPage }: Props): ReactEle
<>
{layout?.map((layoutElement, index) => (
<ReusableBlocks
key={
layoutElement.id ??
layoutElement.blockName ??
`${layoutElement.blockType}${index}`
}
key={layoutElement.id ?? layoutElement.blockName ?? `${layoutElement.blockType}${index}`}
layoutElement={layoutElement}
circles={circles}
previousBlock={layout[index - 1]?.blockType ?? 'none'}
Expand Down
10 changes: 1 addition & 9 deletions components/blocks/reusableLayout/ReusableBlockLayoutPartial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@ import type { ReactElement } from 'react';
import type { Page } from '@/types/payload/payload-types';
import ReusableBlockLayout from '@blocks/reusableLayout/ReusableBlockLayout';

const ReusableBlockLayoutPartial = ({
page,
start,
end,
}: {
page: Page;
start: number;
end?: number;
}): ReactElement => {
const ReusableBlockLayoutPartial = ({ page, start, end }: { page: Page; start: number; end?: number }): ReactElement => {
if (!page.layout) {
return <div />;
}
Expand Down
Loading