-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Privacy Policy Page + Redirect (#345)
Co-authored-by: Hugo Marques <[email protected]>
- Loading branch information
1 parent
b6d93c8
commit dc4193a
Showing
6 changed files
with
67 additions
and
27 deletions.
There are no files selected for viewing
8 changes: 4 additions & 4 deletions
8
src/page-components/Libera.tsx → src/page-components/Libera/Libera.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React, { useEffect } from 'react'; | ||
|
||
export const PrivacyPolicy = () => { | ||
useEffect(() => { | ||
window.location.href = | ||
'https://app.websitepolicies.com/policies/view/9nlgm1po'; | ||
}, []); | ||
|
||
return <></>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// eslint-disable-next-line import/named | ||
import { ClientConfig } from '@prismicio/client'; | ||
import { GetStaticProps } from 'next'; | ||
import { Libera } from '../../page-components'; | ||
import Prismic from '../../lib/Prismic/Prismic'; | ||
import getTypesToFetchWithConfigs from '../../lib/Prismic/helpers/getTypesToFetchWithConfigs'; | ||
|
||
export const getStaticProps: GetStaticProps = async ({ | ||
locale: lang, | ||
previewData | ||
}) => { | ||
const clientOptions = previewData as ClientConfig; | ||
const types = getTypesToFetchWithConfigs([ | ||
'website_libera', | ||
'website_stories' | ||
]); | ||
|
||
const data = await Prismic.getByTypes({ clientOptions, lang, types }); | ||
|
||
return { | ||
props: { | ||
data, | ||
page: 'libera' | ||
} | ||
}; | ||
}; | ||
|
||
export default Libera; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { ClientConfig } from '@prismicio/client'; | ||
import { GetStaticProps } from 'next'; | ||
import { PrivacyPolicy } from '../../page-components/Libera/PrivacyPolicy'; | ||
import Prismic from '../../lib/Prismic/Prismic'; | ||
import getTypesToFetchWithConfigs from '../../lib/Prismic/helpers/getTypesToFetchWithConfigs'; | ||
|
||
export const getStaticProps: GetStaticProps = async ({ | ||
locale: lang, | ||
previewData | ||
}) => { | ||
const clientOptions = previewData as ClientConfig; | ||
const types = getTypesToFetchWithConfigs(['website_libera']); | ||
|
||
const data = await Prismic.getByTypes({ clientOptions, lang, types }); | ||
|
||
return { | ||
props: { | ||
data, | ||
page: 'libera' | ||
} | ||
}; | ||
}; | ||
|
||
export default PrivacyPolicy; |