Skip to content

Commit fa6f613

Browse files
committed
Fix export to support Cloudflare Pages
1 parent e0bfc98 commit fa6f613

File tree

8 files changed

+124
-100
lines changed

8 files changed

+124
-100
lines changed

app/contact/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
useScroll,
99
} from 'framer-motion'
1010
import { useEffect, useRef, useState } from 'react'
11-
import Footer from '@/components/footer.tsx/footer'
11+
import Footer from '@/components/footer/footer'
1212
import { Noto_Serif_Display } from 'next/font/google'
1313

1414
const notoSerifDisplay = Noto_Serif_Display({

app/keys/page.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Header from '@/components/header/header'
33
import styles from '@/app/keys/page.module.css'
44
import { motion, useMotionValueEvent, useScroll } from 'framer-motion'
55
import { useState } from 'react'
6-
import Footer from '@/components/footer.tsx/footer'
6+
import Footer from '@/components/footer/footer'
77

88
export default function Keys() {
99
const [isVisible, setIsVisible] = useState(true)
@@ -151,11 +151,7 @@ export default function Keys() {
151151
</div>
152152
</div>
153153

154-
<hr
155-
className={
156-
'text-raisinblack-400 bg-raisinblack-400 h-[2px]'
157-
}
158-
/>
154+
<hr className={'text-raisinblack-400 bg-raisinblack-400 h-[2px]'} />
159155
<Footer />
160156
</>
161157
)

app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { motion, useMotionValueEvent, useScroll } from 'framer-motion'
66
import styles from '@/app/page.module.css'
77
import Header from '@/components/header/header'
88
import Body from '@/components/body/body'
9-
import Footer from '@/components/footer.tsx/footer'
9+
import Footer from '@/components/footer/footer'
1010

1111
export default function Home() {
1212
const [isVisible, setIsVisible] = useState(true)

app/redirect/page.tsx

Lines changed: 5 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,12 @@
11
'use client'
22

3-
import { Noto_Serif_Display } from 'next/font/google'
4-
import { useSearchParams } from 'next/navigation'
5-
import { useRouter } from 'next/navigation'
6-
import { useEffect, useState } from 'react'
7-
8-
const notoSerifDisplay = Noto_Serif_Display({
9-
subsets: ['latin'],
10-
weight: 'variable',
11-
})
3+
import RedirectComponent from '@/components/redirect/redirect'
4+
import { Suspense } from 'react'
125

136
export default function Redirect() {
14-
const searchParams = useSearchParams()
15-
const router = useRouter()
16-
17-
const [secondsRemaining, setSecondsRemaining] = useState(7)
18-
19-
useEffect(() => {
20-
if (secondsRemaining == 0) {
21-
router.push(`${searchParams.get('url')}`)
22-
}
23-
24-
const interval = setTimeout(() => {
25-
setSecondsRemaining(prevSeconds =>
26-
prevSeconds == 0 ? 0 : prevSeconds - 1,
27-
)
28-
}, 1000)
29-
return () => clearInterval(interval)
30-
}, [router, searchParams, secondsRemaining])
31-
327
return (
33-
<div className="h-screen mt-0 mx-7 lg:mx-20 space-x-4 sm:space-x-0 space-y-10 sm:space-y-0 justify-center flex">
34-
<div className="flex flex-col justify-center text-center items-center">
35-
<h1
36-
className={`${notoSerifDisplay.className} header-text flex items-center space-x-2 sm:space-x-4`}>
37-
<svg
38-
xmlns="http://www.w3.org/2000/svg"
39-
fill="none"
40-
viewBox="0 0 24 24"
41-
strokeWidth="1.5"
42-
stroke="currentColor"
43-
className="h-[1.5rem] w-[1.5rem] sm:h-[2.5rem] sm:w-[2.5rem] md:h-[3rem] md:w-[3rem]">
44-
<path
45-
strokeLinecap="round"
46-
strokeLinejoin="round"
47-
d="M10.05 4.575a1.575 1.575 0 10-3.15 0v3m3.15-3v-1.5a1.575 1.575 0 013.15 0v1.5m-3.15 0l.075 5.925m3.075.75V4.575m0 0a1.575 1.575 0 013.15 0V15M6.9 7.575a1.575 1.575 0 10-3.15 0v8.175a6.75 6.75 0 006.75 6.75h2.018a5.25 5.25 0 003.712-1.538l1.732-1.732a5.25 5.25 0 001.538-3.712l.003-2.024a.668.668 0 01.198-.471 1.575 1.575 0 10-2.228-2.228 3.818 3.818 0 00-1.12 2.687M6.9 7.575V12m6.27 4.318A4.49 4.49 0 0116.35 15m.002 0h-.002"
48-
/>
49-
</svg>
50-
<span>Hold the phone!</span>
51-
</h1>
52-
<p className="text-lg sm:text-xl md:text-2xl xl:text-3xl">
53-
You&apos;re being redirected away from reprogle.org to{' '}
54-
<span className="highlight-orange">
55-
{searchParams.get('site')}
56-
</span>
57-
. <br />
58-
<br /> Please note that personal social media sites reflect
59-
my own opinions or beliefs, and do not necessarily reflect
60-
the beliefs of my current or previous employers. Social
61-
media profiles will always adhere to my employers&apos; Code
62-
of Ethical and Professional Standards, Non-Discrimination
63-
Policy, and Employee Confidentiality Agreement.
64-
<br />
65-
<br />
66-
You will be redirected in {secondsRemaining}{' '}
67-
{`${secondsRemaining === 1 ? 'second' : 'seconds'}`}.
68-
</p>
69-
</div>
70-
</div>
8+
<Suspense>
9+
<RedirectComponent />
10+
</Suspense>
7111
)
7212
}
File renamed without changes.

components/redirect/redirect.tsx

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
'use client'
2+
3+
import { Noto_Serif_Display } from 'next/font/google'
4+
import Link from 'next/link'
5+
import { useSearchParams } from 'next/navigation'
6+
import { useRouter } from 'next/navigation'
7+
import { useEffect, useState } from 'react'
8+
9+
const notoSerifDisplay = Noto_Serif_Display({
10+
subsets: ['latin'],
11+
weight: 'variable',
12+
})
13+
14+
export default function RedirectComponent() {
15+
const searchParams = useSearchParams()
16+
const router = useRouter()
17+
18+
const [secondsRemaining, setSecondsRemaining] = useState(7)
19+
20+
useEffect(() => {
21+
if (secondsRemaining == 0) {
22+
router.push(`${searchParams.get('url')}`)
23+
}
24+
25+
const interval = setTimeout(() => {
26+
setSecondsRemaining(prevSeconds =>
27+
prevSeconds == 0 ? 0 : prevSeconds - 1,
28+
)
29+
}, 1000)
30+
return () => clearInterval(interval)
31+
}, [router, searchParams, secondsRemaining])
32+
33+
return (
34+
<div className="h-screen mt-0 mx-7 lg:mx-20 space-x-4 sm:space-x-0 space-y-10 sm:space-y-0 justify-center flex">
35+
<div className="flex flex-col justify-center text-center items-center">
36+
<h1
37+
className={`${notoSerifDisplay.className} header-text flex items-center space-x-2 sm:space-x-4`}>
38+
<svg
39+
xmlns="http://www.w3.org/2000/svg"
40+
fill="none"
41+
viewBox="0 0 24 24"
42+
strokeWidth="1.5"
43+
stroke="currentColor"
44+
className="h-[1.5rem] w-[1.5rem] sm:h-[2.5rem] sm:w-[2.5rem] md:h-[3rem] md:w-[3rem]">
45+
<path
46+
strokeLinecap="round"
47+
strokeLinejoin="round"
48+
d="M10.05 4.575a1.575 1.575 0 10-3.15 0v3m3.15-3v-1.5a1.575 1.575 0 013.15 0v1.5m-3.15 0l.075 5.925m3.075.75V4.575m0 0a1.575 1.575 0 013.15 0V15M6.9 7.575a1.575 1.575 0 10-3.15 0v8.175a6.75 6.75 0 006.75 6.75h2.018a5.25 5.25 0 003.712-1.538l1.732-1.732a5.25 5.25 0 001.538-3.712l.003-2.024a.668.668 0 01.198-.471 1.575 1.575 0 10-2.228-2.228 3.818 3.818 0 00-1.12 2.687M6.9 7.575V12m6.27 4.318A4.49 4.49 0 0116.35 15m.002 0h-.002"
49+
/>
50+
</svg>
51+
<span>Hold the phone!</span>
52+
</h1>
53+
<p className="text-lg sm:text-xl md:text-2xl xl:text-3xl">
54+
You&apos;re being redirected away from reprogle.org to{' '}
55+
<span className="highlight-orange">
56+
{searchParams.get('site')}
57+
</span>
58+
. <br />
59+
<br /> Please note that personal social media sites reflect
60+
my own opinions or beliefs, and do not necessarily reflect
61+
the beliefs of my current or previous employers. Social
62+
media profiles will always adhere to my employers&apos; Code
63+
of Ethical and Professional Standards, Non-Discrimination
64+
Policy, and Employee Confidentiality Agreement.
65+
<br />
66+
<br />
67+
You will be redirected in {secondsRemaining}{' '}
68+
{`${secondsRemaining === 1 ? 'second' : 'seconds'}`}. If you
69+
are not redirected,{' '}
70+
<Link
71+
href={`${searchParams.get('url')}`}
72+
className="underline">
73+
click here
74+
</Link>
75+
.
76+
</p>
77+
</div>
78+
</div>
79+
)
80+
}

next.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ const nextConfig = {
55
},
66
images: {
77
loader: 'custom',
8-
loaderFile: './imageLoader.js'
9-
}
8+
loaderFile: './imageLoader.js',
9+
},
10+
output: 'export',
1011
}
1112

1213
module.exports = nextConfig

tsconfig.json

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
11
{
2-
"compilerOptions": {
3-
"target": "es5",
4-
"lib": ["dom", "dom.iterable", "esnext"],
5-
"allowJs": true,
6-
"skipLibCheck": true,
7-
"strict": true,
8-
"forceConsistentCasingInFileNames": true,
9-
"noEmit": true,
10-
"esModuleInterop": true,
11-
"module": "esnext",
12-
"moduleResolution": "node",
13-
"resolveJsonModule": true,
14-
"isolatedModules": true,
15-
"jsx": "preserve",
16-
"incremental": true,
17-
"plugins": [
18-
{
19-
"name": "next"
20-
}
2+
"compilerOptions": {
3+
"target": "es5",
4+
"lib": ["dom", "dom.iterable", "esnext"],
5+
"allowJs": true,
6+
"skipLibCheck": true,
7+
"strict": true,
8+
"forceConsistentCasingInFileNames": true,
9+
"noEmit": true,
10+
"esModuleInterop": true,
11+
"module": "esnext",
12+
"moduleResolution": "node",
13+
"resolveJsonModule": true,
14+
"isolatedModules": true,
15+
"jsx": "preserve",
16+
"incremental": true,
17+
"plugins": [
18+
{
19+
"name": "next"
20+
}
21+
],
22+
"paths": {
23+
"@/*": ["./*"]
24+
}
25+
},
26+
"include": [
27+
"next-env.d.ts",
28+
"**/*.ts",
29+
"**/*.tsx",
30+
".next/types/**/*.ts",
31+
"imageLoader.js",
32+
"components/footer"
2133
],
22-
"paths": {
23-
"@/*": ["./*"]
24-
}
25-
},
26-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "imageLoader.js"],
27-
"exclude": ["node_modules"]
34+
"exclude": ["node_modules"]
2835
}

0 commit comments

Comments
 (0)