Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add privacy policy and translate license text #317

Merged
merged 1 commit into from
Jun 10, 2024
Merged
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
9 changes: 9 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import ContentWrapper from './components/ContentWrapper/ContentWrapper';
import AdminAuthWrapper from './components/AdminAuthWrapper/AdminAuthWrapper';
import LangProvider from './components/LangProvider/LangProvider';
import AuthProvider from './components/AuthProvider/AuthProvider';
import PrivacyPolicy from './components/ContentWrapper/PrivacyPolicy/PrivacyPolicy';

/**
* Root Component
Expand Down Expand Up @@ -146,6 +147,14 @@ export default function App() {
</ContentWrapper>
}
/>
<Route
path="/privacy-policy"
element={
<ContentWrapper>
<PrivacyPolicy />
</ContentWrapper>
}
/>
</Routes>
</Router>
</AuthProvider>
Expand Down
4 changes: 0 additions & 4 deletions src/components/ContentWrapper/Footer/Footer.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,4 @@

.footer-link:hover {
color: #06f87f;
}

.datenschutzerklaerung {
display: none;
}
Expand Down
4 changes: 0 additions & 4 deletions src/components/ContentWrapper/Footer/Footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,3 @@
.footer-link:hover {
color: $amplimind-accent-green;
}

.datenschutzerklaerung {
display: none;
}
9 changes: 5 additions & 4 deletions src/components/ContentWrapper/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import './Footer.css';
import { useTranslation } from 'react-i18next';
import { Link } from 'react-router-dom';

/**
* Footer component that displays the footer of the application.
Expand Down Expand Up @@ -34,11 +35,11 @@ export default function Footer() {
>
GitHub
</a>
<a className="footer-link datenschutzerklaerung" href="">
GitHub
</a>
<Link to="/privacy-policy" className="footer-link datenschutzerklaerung">
{t('privacyPolicy', {ns: "privacyPolicy"})}
</Link>
</div>
<p data-testid="license-text">License Text</p>
<p data-testid="license-text">{t('licenseText', {ns: "license"})}</p>
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import '../../../theme/theme.scss';

.privacy-policy-container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 20px;
}
12 changes: 12 additions & 0 deletions src/components/ContentWrapper/PrivacyPolicy/PrivacyPolicy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import './PrivacyPolicy.css';
import { useTranslation } from 'react-i18next';

export default function PrivacyPolicy() {
const { t } = useTranslation('privacyPolicy');
return (
<div className="privacy-policy-container">
<h1>{t('privacyPolicy')}</h1>
your content here
</div>
);
}
8 changes: 8 additions & 0 deletions src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import enInvite from './locales/en/invite.json';
import enResetPassword from './locales/en/resetPassword.json';
import enAdmin from './locales/en/admin.json';
import enPasswordStrength from './locales/en/passwordStrength.json';
import enLicense from './locales/en/license.json';
import enPrivacyPolicy from './locales/en/privacyPolicy.json';

// Deutsch / German
import deMain from './locales/de/main.json';
Expand All @@ -19,6 +21,8 @@ import deInvite from './locales/de/invite.json';
import deResetPassword from './locales/de/resetPassword.json';
import deAdmin from './locales/de/admin.json';
import dePasswordStrength from './locales/de/passwordStrength.json';
import deLicense from './locales/de/license.json';
import dePrivacyPolicy from './locales/de/privacyPolicy.json';

const resources = {
en: {
Expand All @@ -29,6 +33,8 @@ const resources = {
resetPassword: enResetPassword,
admin: enAdmin,
passwordStrength: enPasswordStrength,
license: enLicense,
privacyPolicy: enPrivacyPolicy,
},
de: {
main: deMain,
Expand All @@ -38,6 +44,8 @@ const resources = {
resetPassword: deResetPassword,
admin: deAdmin,
passwordStrength: dePasswordStrength,
license: deLicense,
privacyPolicy: dePrivacyPolicy,
},
};

Expand Down
3 changes: 3 additions & 0 deletions src/locales/de/license.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"licenseText": "Lizenztext"
}
3 changes: 3 additions & 0 deletions src/locales/de/privacyPolicy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"privacyPolicy": "Datenschutzerklärung"
}
3 changes: 3 additions & 0 deletions src/locales/en/license.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"licenseText": "License Text"
}
3 changes: 3 additions & 0 deletions src/locales/en/privacyPolicy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"privacyPolicy": "Privacy Policy"
}