mirror of
https://github.com/DerTyp7/f1r3wave-website.git
synced 2025-10-29 13:02:09 +01:00
Do not show imprint when disabled in config.json
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"imprint": {
|
"imprint": {
|
||||||
"enable": true,
|
"enable": false,
|
||||||
"headline": "Imprint / Legal Notice",
|
"headline": "Imprint / Legal Notice",
|
||||||
"name": "[Your Full Name]",
|
"name": "[Your Full Name]",
|
||||||
"address": "[Your Full Address: Street and House Number, Postcode City]",
|
"address": "[Your Full Address: Street and House Number, Postcode City]",
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
|
import { useConfig } from '@/contexts/configExports';
|
||||||
import styles from '@/styles/Footer.module.scss';
|
import styles from '@/styles/Footer.module.scss';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { usePathname } from 'next/navigation';
|
import { usePathname } from 'next/navigation';
|
||||||
@@ -12,6 +13,7 @@ interface FooterProps {
|
|||||||
export default function Footer({ currentYear }: FooterProps) {
|
export default function Footer({ currentYear }: FooterProps) {
|
||||||
const [isInLandingPage, setIsInLandingPage] = useState<boolean>(false);
|
const [isInLandingPage, setIsInLandingPage] = useState<boolean>(false);
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
|
const { config } = useConfig();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setIsInLandingPage(pathname === '/');
|
setIsInLandingPage(pathname === '/');
|
||||||
@@ -20,9 +22,13 @@ export default function Footer({ currentYear }: FooterProps) {
|
|||||||
return (
|
return (
|
||||||
<footer className={`${styles.footer} ${isInLandingPage ? styles.footerLandingPage : ''}`}>
|
<footer className={`${styles.footer} ${isInLandingPage ? styles.footerLandingPage : ''}`}>
|
||||||
<div className={styles.links}>
|
<div className={styles.links}>
|
||||||
<Link href="/imprint" className={styles.linksLink}>
|
{config?.contact.imprint.enable ? (
|
||||||
Imprint
|
<Link href="/imprint" className={styles.linksLink}>
|
||||||
</Link>
|
Imprint
|
||||||
|
</Link>
|
||||||
|
) : (
|
||||||
|
''
|
||||||
|
)}
|
||||||
<Link
|
<Link
|
||||||
href="https://github.com/DerTyp7/f1r3wave-website"
|
href="https://github.com/DerTyp7/f1r3wave-website"
|
||||||
className={styles.linksLink}
|
className={styles.linksLink}
|
||||||
|
|||||||
@@ -2,9 +2,15 @@
|
|||||||
|
|
||||||
import { useConfig } from '@/contexts/configExports';
|
import { useConfig } from '@/contexts/configExports';
|
||||||
import styles from '@/styles/Imprint.module.scss';
|
import styles from '@/styles/Imprint.module.scss';
|
||||||
|
import { useRouter } from 'next/navigation';
|
||||||
|
|
||||||
export default function Imprint() {
|
export default function Imprint() {
|
||||||
const { config } = useConfig();
|
const { config } = useConfig();
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
if (!config || !config?.contact.imprint.enable) {
|
||||||
|
router.push('/');
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.imprint}>
|
<div className={styles.imprint}>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
"use client";
|
'use client';
|
||||||
|
|
||||||
import { ConfigContextType } from '@/interfaces/config';
|
import { ConfigContextType } from '@/interfaces/config';
|
||||||
import { createContext, useContext } from 'react';
|
import { createContext, useContext } from 'react';
|
||||||
|
|||||||
Reference in New Issue
Block a user