Skip to content

Commit c638fb2

Browse files
committed
Add privacy policy in footer
1 parent fce5457 commit c638fb2

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

components/Footer.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ import * as config from '@/lib/config'
1414
import { useDarkMode } from '@/lib/use-dark-mode'
1515

1616
import styles from './styles.module.css'
17+
import { useNotionContext } from 'react-notion-x'
1718

1819
// TODO: merge the data and icons from PageSocial with the social links in Footer
1920

2021
export const FooterImpl: React.FC = () => {
2122
const [hasMounted, setHasMounted] = React.useState(false)
2223
const { isDarkMode, toggleDarkMode } = useDarkMode()
24+
const { mapPageUrl } = useNotionContext()
2325

2426
const onToggleDarkMode = React.useCallback(
2527
(e) => {
@@ -36,7 +38,17 @@ export const FooterImpl: React.FC = () => {
3638
return (
3739
<footer className={styles.footer}>
3840
<div className={styles.copyright}>Copyright 2022 {config.author}</div>
39-
41+
{config.privacyPolicy && (
42+
<a
43+
className={styles.copyright}
44+
href={mapPageUrl(config.privacyPolicy)}
45+
title='Privacy Policy'
46+
target='_blank'
47+
rel='noopener noreferrer'
48+
>
49+
Privacy Policy
50+
</a>
51+
)}
4052
<div className={styles.settings}>
4153
{hasMounted && (
4254
<a

lib/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const youtube: string | null = getSiteConfig('youtube', null)
6161
export const linkedin: string | null = getSiteConfig('linkedin', null)
6262
export const newsletter: string | null = getSiteConfig('newsletter', null)
6363
export const zhihu: string | null = getSiteConfig('zhihu', null)
64-
64+
export const privacyPolicy : string | null = getSiteConfig('privacyPolicy', null)
6565
export const getMastodonHandle = (): string | null => {
6666
if (!mastodon) {
6767
return null

lib/site-config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export interface SiteConfig {
1717
youtube?: string
1818
zhihu?: string
1919
mastodon?: string;
20+
privacyPolicy?: string;
2021

2122
googleAnalyticsId?: string | null
2223
disqusShortname?: string | null

site.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default siteConfig({
2323
mastodon: 'https://indieweb.social/@Yeraze', // optional mastodon profile URL, provides link verification
2424
// newsletter: '#', // optional newsletter URL
2525
// youtube: '#', // optional youtube channel name or `channel/UCGbXXXXXXXXXXXXXXXXXXXXXX`
26-
26+
privacyPolicy: '64f7bf74081041139f049af5f9b88017',
2727
// default notion icon and cover images for site-wide consistency (optional)
2828
// page-specific values will override these site-wide defaults
2929
defaultPageIcon: null,

0 commit comments

Comments
 (0)