Skip to content

Commit 2e6f1e9

Browse files
committed
modifying proxyrequest
1 parent 5b99845 commit 2e6f1e9

File tree

13 files changed

+242
-179
lines changed

13 files changed

+242
-179
lines changed

app/Content.tsx

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,59 @@ export const metadata: Metadata = {
1717
title: 'Stuff by Hoagie',
1818
};
1919

20+
const RainbowLogo = () => (
21+
<Pane whiteSpace='nowrap'>
22+
<Text
23+
is='h2'
24+
display='inline-block'
25+
className='hoagie logo'
26+
color='grey900'
27+
>
28+
hoagie
29+
</Text>
30+
<Paragraph
31+
is='h2'
32+
display='inline-block'
33+
color='blue500'
34+
className='hoagie logo rainbow-text'
35+
>
36+
stuff
37+
</Paragraph>
38+
</Pane>
39+
);
40+
41+
const RainbowHeader = () => (
42+
<Pane
43+
width='100%'
44+
height={20}
45+
display='flex'
46+
flexDirection='row'
47+
style={{
48+
backgroundImage: `linear-gradient(
49+
90deg,
50+
hsl(0deg 73% 75%) 0%,
51+
hsl(12deg 94% 76%) 19%,
52+
hsl(22deg 100% 75%) 27%,
53+
hsl(33deg 100% 74%) 34%,
54+
hsl(44deg 82% 72%) 41%,
55+
hsl(69deg 51% 70%) 47%,
56+
hsl(107deg 44% 75%) 53%,
57+
hsl(149deg 45% 73%) 59%,
58+
hsl(175deg 52% 64%) 66%,
59+
hsl(190deg 77% 57%) 73%,
60+
hsl(201deg 97% 62%) 81%,
61+
hsl(225deg 100% 76%) 100%
62+
)`,
63+
}}
64+
>
65+
{/* <Pane width="20%" height={20} background="red500" />
66+
<Pane width="20%" height={20} background="yellow300" />
67+
<Pane width="20%" height={20} background="green300" />
68+
<Pane width="20%" height={20} background="teal300" />
69+
<Pane width="20%" height={20} background="rblue300" /> */}
70+
</Pane>
71+
);
72+
2073
export default function Content({
2174
children,
2275
}: {

app/all/[pid]/page.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import { withPageAuthRequired } from '@auth0/nextjs-auth0/client';
44

55
import PostPage from '@/components/PostPage';
66

7-
export default withPageAuthRequired(() => {
8-
return <PostPage />;
7+
type Params = {
8+
params: { pid: string };
9+
};
10+
11+
export default withPageAuthRequired(({ params }: Params) => {
12+
const { pid } = params;
13+
const pageNumber = pid ? parseInt(pid, 10) : 1;
14+
return <PostPage pageNumber={pageNumber} />;
915
});

app/all/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ import { withPageAuthRequired } from '@auth0/nextjs-auth0/client';
55
import PostPage from '@/components/PostPage';
66

77
export default withPageAuthRequired(() => {
8-
return <PostPage />;
8+
return <PostPage pageNumber={1} />;
99
});

app/api/hoagie/[...path]/route.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ async function handler(
1111
request: NextRequest,
1212
{ params }: { params: Promise<{ path: string[] }> }
1313
) { // Not very good, fix this later
14+
console.log('HOAGIE_API_URL:', process.env.HOAGIE_API_URL)
1415
const path = (await params).path.join('/');
1516
const queryString = request.nextUrl.searchParams.toString();
1617

@@ -36,7 +37,7 @@ async function handler(
3637
}
3738

3839
return await proxyRequest(
39-
`${process.env.HOAGIE_API_URL}${path}/?${queryString}`,
40+
`${process.env.HOAGIE_API_URL}${path}?${queryString}`,
4041
fetchReq
4142
);
4243
};

app/bulletins/[pid]/page.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import { withPageAuthRequired } from '@auth0/nextjs-auth0/client';
44

55
import PostPage from '@/components/PostPage';
66

7-
export default withPageAuthRequired(() => {
8-
return <PostPage category='bulletin' />;
7+
type Params = {
8+
params: { pid: string };
9+
};
10+
11+
export default withPageAuthRequired(({ params }: Params) => {
12+
const { pid } = params;
13+
const pageNumber = pid ? parseInt(pid, 10) : 1;
14+
return <PostPage pageNumber={pageNumber} category='bulletin' />;
915
});

app/bulletins/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ import { withPageAuthRequired } from '@auth0/nextjs-auth0/client';
44

55
import PostPage from '@/components/PostPage';
66

7-
export default withPageAuthRequired(() => <PostPage category='bulletin' />);
7+
export default withPageAuthRequired(() => (
8+
<PostPage pageNumber={1} category='bulletin' />
9+
));

app/lost/[pid]/page.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import { withPageAuthRequired } from '@auth0/nextjs-auth0/client';
44

55
import PostPage from '@/components/PostPage';
66

7-
export default withPageAuthRequired(() => {
8-
return <PostPage category='lost' />;
7+
type Params = {
8+
params: { pid: string };
9+
};
10+
11+
export default withPageAuthRequired(({ params }: Params) => {
12+
const { pid } = params;
13+
const pageNumber = pid ? parseInt(pid, 10) : 1;
14+
return <PostPage pageNumber={pageNumber} category='lost' />;
915
});

app/lost/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ import { withPageAuthRequired } from '@auth0/nextjs-auth0/client';
44

55
import PostPage from '@/components/PostPage';
66

7-
export default withPageAuthRequired(() => <PostPage category='lost' />);
7+
export default withPageAuthRequired(() => (
8+
<PostPage pageNumber={1} category='lost' />
9+
));

app/marketplace/[pid]/page.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import { withPageAuthRequired } from '@auth0/nextjs-auth0/client';
44

55
import PostPage from '@/components/PostPage';
66

7-
export default withPageAuthRequired(() => {
8-
return <PostPage category='marketplace' />;
7+
type Params = {
8+
params: { pid: string };
9+
};
10+
11+
export default withPageAuthRequired(({ params }: Params) => {
12+
const { pid } = params;
13+
const pageNumber = pid ? parseInt(pid, 10) : 1;
14+
return <PostPage pageNumber={pageNumber} category='marketplace' />;
915
});

app/marketplace/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ import { withPageAuthRequired } from '@auth0/nextjs-auth0/client';
44

55
import PostPage from '@/components/PostPage';
66

7-
export default withPageAuthRequired(() => <PostPage category='marketplace' />);
7+
export default withPageAuthRequired(() => (
8+
<PostPage pageNumber={1} category='marketplace' />
9+
));

0 commit comments

Comments
 (0)