Skip to content

Commit

Permalink
feat: move public id to env
Browse files Browse the repository at this point in the history
so other who forked this repo can immediately change the env
  • Loading branch information
theodorusclarence committed Jan 1, 2023
1 parent ada9dd5 commit 15af1af
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 11 deletions.
9 changes: 8 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,11 @@ SPOTIFY_REFRESH_TOKEN=
ADMIN_PASSWORD=admin

# Revue Subscription
REVUE_TOKEN=
REVUE_TOKEN=

# Client .envs
# These envs are feature flagged in constants/env.ts. No need to fill them in if you won't use it
NEXT_PUBLIC_FEEDBACK_FISH_ID=
NEXT_PUBLIC_GISCUS_REPO=
NEXT_PUBLIC_GISCUS_REPO_ID=
NEXT_PUBLIC_BLOCK_DOMAIN_WHITELIST="theodorusclarence.com"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"dependencies": {
"@feedback-fish/react": "^1.2.1",
"@giscus/react": "^1.1.2",
"@giscus/react": "^2.2.6",
"@headlessui/react": "^1.7.7",
"@prisma/client": "^4.7.1",
"axios": "^0.24.0",
Expand Down
6 changes: 3 additions & 3 deletions src/components/content/Comment.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Giscus, Theme } from '@giscus/react';
import Giscus, { Repo, Theme } from '@giscus/react';
import { useTheme } from 'next-themes';

import { commentFlag } from '@/constants/env';
Expand All @@ -9,8 +9,8 @@ export default function Comment() {
return commentFlag ? (
<Giscus
key={theme}
repo='theodorusclarence/theodorusclarence.com'
repoId='MDEwOlJlcG9zaXRvcnkzMzAyMTQyNDc='
repo={(process.env.NEXT_PUBLIC_GISCUS_REPO as Repo) || ''}
repoId={process.env.NEXT_PUBLIC_GISCUS_REPO_ID || ''}
category='General'
categoryId='DIC_kwDOE66rZ84B--B0'
mapping='pathname'
Expand Down
4 changes: 3 additions & 1 deletion src/components/layout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export default function Footer() {
{feedbackFlag && (
<>
{' • '}
<FeedbackFish projectId='59a0c0e0d549a7'>
<FeedbackFish
projectId={process.env.NEXT_PUBLIC_FEEDBACK_FISH_ID || ''}
>
<button className='rounded-sm hover:text-gray-800 focus:outline-none focus-visible:ring focus-visible:ring-primary-300 dark:hover:text-gray-100'>
Got any feedback?
</button>
Expand Down
7 changes: 6 additions & 1 deletion src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ Router.events.on('routeChangeComplete', nProgress.done);
function MyApp({ Component, pageProps }: AppProps) {
React.useEffect(() => {
// Don't increment views if not on main domain
if (window.location.host !== 'theodorusclarence.com' && blockDomainMeta) {
if (
window.location.host !==
(process.env.NEXT_PUBLIC_BLOCK_DOMAIN_WHITELIST ||
'theodorusclarence.com') &&
blockDomainMeta
) {
if (getFromLocalStorage('incrementMetaFlag') !== 'false') {
localStorage.setItem('incrementMetaFlag', 'false');
// reload page to make changes
Expand Down
51 changes: 47 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,12 @@
resolved "https://registry.yarnpkg.com/@feedback-fish/react/-/react-1.2.1.tgz#b4d226f310df936517e9e5e82397806a5df4e2d8"
integrity sha512-4YFD2hE93xBIT/Ko0x0l6UB0OyaxJcWKLGrnznsUVoLE5Q9vB8I1LEbMySYyuvbU9ul3yM3FjGkVZhYVPdwEyA==

"@giscus/react@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@giscus/react/-/react-1.1.2.tgz#c97f06aab1272c0fbe567c69ebffe3bad7206e7a"
integrity sha512-htSAAiTtoHTRE8GqSSkWmT+Iq7LJhtqSmr+HjEC1cXlNd1WeLVZXjnuiIj7+L8DOUnAdfh+1FClN304FVxIcsQ==
"@giscus/react@^2.2.6":
version "2.2.6"
resolved "https://registry.yarnpkg.com/@giscus/react/-/react-2.2.6.tgz#893216bf06de71b45280d131a9df6975c22c97f1"
integrity sha512-qGjikDm7euLOCfMPn500d7F3UIl/qI55/dWF4ALC5Fo/7i5qktKCAwy6/zop93PjP0hJL6mi54K6x36SyvaLyQ==
dependencies:
giscus "^1.2.6"

"@headlessui/react@^1.7.7":
version "1.7.7"
Expand Down Expand Up @@ -332,6 +334,11 @@
"@jridgewell/resolve-uri" "^3.0.3"
"@jridgewell/sourcemap-codec" "^1.4.10"

"@lit/reactive-element@^1.3.0", "@lit/reactive-element@^1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@lit/reactive-element/-/reactive-element-1.5.0.tgz#344cc33f2d1491d094b8ef824a9fe31d150d2375"
integrity sha512-fQh9FDK0LPTwDk+0HhSZEtb8K0LTN1wXerwpGrWA+a8tWulYRDLI4vQDWp4GOIsewn0572KYV/oZ3+492D7osA==

"@next/env@12.3.4":
version "12.3.4"
resolved "https://registry.yarnpkg.com/@next/env/-/env-12.3.4.tgz#c787837d36fcad75d72ff8df6b57482027d64a47"
Expand Down Expand Up @@ -717,6 +724,11 @@
resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.3.tgz#ff5e2f1902969d305225a047c8a0fd5c915cebef"
integrity sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==

"@types/trusted-types@^2.0.2":
version "2.0.2"
resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.2.tgz#fc25ad9943bcac11cceb8168db4f275e0e72e756"
integrity sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg==

"@types/umami@^0.1.0":
version "0.1.0"
resolved "https://registry.yarnpkg.com/@types/umami/-/umami-0.1.0.tgz#bf76780c8b60183f35a910db34228627d410a655"
Expand Down Expand Up @@ -2853,6 +2865,13 @@ getpass@^0.1.1:
dependencies:
assert-plus "^1.0.0"

giscus@^1.2.6:
version "1.2.6"
resolved "https://registry.yarnpkg.com/giscus/-/giscus-1.2.6.tgz#0ccdf3bd4e936da95d2e2708446850c1e5ec4496"
integrity sha512-VqMWmCdlUk9krX2M3oMgn9/Y6XEbRXRHtfhNTuRn/AdeGOeko54OFEIsizQ/nYWymuUNGZR48KGptCtYL77rtA==
dependencies:
lit "^2.5.0"

git-raw-commits@^2.0.0:
version "2.0.10"
resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-2.0.10.tgz#e2255ed9563b1c9c3ea6bd05806410290297bbc1"
Expand Down Expand Up @@ -3678,6 +3697,30 @@ listr2@^3.8.3:
through "^2.3.8"
wrap-ansi "^7.0.0"

lit-element@^3.2.0:
version "3.2.2"
resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-3.2.2.tgz#d148ab6bf4c53a33f707a5168e087725499e5f2b"
integrity sha512-6ZgxBR9KNroqKb6+htkyBwD90XGRiqKDHVrW/Eh0EZ+l+iC+u+v+w3/BA5NGi4nizAVHGYvQBHUDuSmLjPp7NQ==
dependencies:
"@lit/reactive-element" "^1.3.0"
lit-html "^2.2.0"

lit-html@^2.2.0, lit-html@^2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-2.5.0.tgz#9d4c0bb3652a6b10bc4ccdb627dfa9eff1215474"
integrity sha512-bLHosg1XL3JRUcKdSVI0sLCs0y1wWrj2sqqAN3cZ7bDDPNgmDHH29RV48x6Wz3ZmkxIupaE+z7uXSZ/pXWAO1g==
dependencies:
"@types/trusted-types" "^2.0.2"

lit@^2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/lit/-/lit-2.5.0.tgz#3a425d69ff8483effb2026957b86ae45de0bc51a"
integrity sha512-DtnUP6vR3l4Q8nRPPNBD+UxbAhwJPeky+OVbi3pdgMqm0g57xFSl1Sj64D1rIB+nVNdiVVg8YxB0hqKjvdadZA==
dependencies:
"@lit/reactive-element" "^1.5.0"
lit-element "^3.2.0"
lit-html "^2.5.0"

load-json-file@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b"
Expand Down

1 comment on commit 15af1af

@vercel
Copy link

@vercel vercel bot commented on 15af1af Jan 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.