Skip to content

Commit

Permalink
Added possibility for imprint and privacy statement on front footer
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristophNiehoff committed Aug 3, 2023
1 parent dd907ea commit ccc8d35
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 11 deletions.
5 changes: 5 additions & 0 deletions docker/client.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM node:16.13.1-alpine3.14 AS builder
ARG EOP_IMPRINT
ARG EOP_PRIVACY
WORKDIR /usr/src/app
COPY package.json ./
COPY package-lock.json ./
Expand All @@ -11,6 +13,9 @@ COPY ./.eslintrc.cjs ./.eslintrc.cjs
COPY ./.prettierignore ./.prettierignore
COPY ./.prettierrc.cjs ./.prettierc.cjs
COPY ./src ./src
ENV REACT_APP_EOP_IMPRINT=$EOP_IMPRINT
ENV REACT_APP_EOP_PRIVACY=$EOP_PRIVACY
RUN env
RUN npm run build:client

FROM nginxinc/nginx-unprivileged:1.20.1-alpine
Expand Down
4 changes: 4 additions & 0 deletions src/client/components/footer/footer.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.footer-container {
display: flex;
justify-content: space-between;
}
33 changes: 22 additions & 11 deletions src/client/components/footer/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import type { FC } from 'react';
import packageJson from '../../../../package.json';
import { faHeart } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import Imprint from './imprint';
import './footer.css';
import Privacy from './privacy';


type FooterProps = {
short?: boolean;
Expand All @@ -12,17 +16,24 @@ const Footer: FC<FooterProps> = ({ short }) => (
<small className="text-muted">
v{packageJson.version}
{!short && (
<span>
{' '}
- made with{' '}
{/* @ts-expect-error @fortawesome/react-fontawesome uses an older version of @fortawesome/fontawesome-svg-core (1.3.0), which makes the types incompatible. It still works correctly at runtime. */}
<FontAwesomeIcon icon={faHeart} style={{ color: '#00cc00' }} /> at
Careem and{' '}
<a href="https://www.tngtech.com/en/">TNG Technology Consulting</a> -
Elevation of Privilege was originally invented at Microsoft, Cornucopia
was developed at OWASP, Cumulus was started at{' '}
<a href="https://www.tngtech.com/en/">TNG Technology Consulting</a>.
</span>
<>
<span>
{' '}
- made with{' '}
{/* @ts-expect-error @fortawesome/react-fontawesome uses an older version of @fortawesome/fontawesome-svg-core (1.3.0), which makes the types incompatible. It still works correctly at runtime. */}
<FontAwesomeIcon icon={faHeart} style={{ color: '#00cc00' }} /> at
Careem and{' '}
<a href="https://www.tngtech.com/en/">TNG Technology Consulting</a> -
Elevation of Privilege was originally invented at Microsoft, Cornucopia
was developed at OWASP, Cumulus was started at{' '}
<a href="https://www.tngtech.com/en/">TNG Technology Consulting</a>.
</span>
<div className='footer-container'>
<Imprint />
<Privacy />
</div>

</>
)}
</small>
);
Expand Down
14 changes: 14 additions & 0 deletions src/client/components/footer/imprint.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';
import type { FC } from 'react';

const Imprint: FC = () => {
if (process.env.REACT_APP_EOP_IMPRINT) {
return (
<a href={process.env.REACT_APP_EOP_IMPRINT}>Imprint</a>
);
}
return (<></>);

}

export default Imprint;
13 changes: 13 additions & 0 deletions src/client/components/footer/privacy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';
import type { FC } from 'react';

const Privacy: FC = () => {
if (process.env.REACT_APP_EOP_PRIVACY) {
return (
<a href={process.env.REACT_APP_EOP_PRIVACY}>Privacy</a>
);
}
return (<></>);
}

export default Privacy;

0 comments on commit ccc8d35

Please sign in to comment.