Skip to content

Commit 697b6cb

Browse files
committed
feat: fix collapsing container and footer render issue; add docs page for /cli API
1 parent 8a95bfb commit 697b6cb

16 files changed

Lines changed: 198 additions & 36 deletions

File tree

package-lock.json

Lines changed: 45 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,10 @@
8484
"typecheck": "tsc --noEmit"
8585
},
8686
"dependencies": {
87-
"@mantine/core": "^7.16.3",
88-
"@mantine/hooks": "^7.16.3",
89-
"@mantine/notifications": "^7.16.3",
87+
"@mantine/code-highlight": "^7.17.0",
88+
"@mantine/core": "^7.17.0",
89+
"@mantine/hooks": "^7.17.0",
90+
"@mantine/notifications": "^7.17.0",
9091
"@next/bundle-analyzer": "^15.1.5",
9192
"@sparticuz/chromium": "^132.0.0",
9293
"@supabase/ssr": "^0.5.2",

src/app/_components/DeveloperSettingsTab/index.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { Box, Stack, Title } from '@mantine/core';
1+
import Link from 'next/link';
2+
import { Anchor, Box, Stack, Text, Title } from '@mantine/core';
3+
import ApiKeyGenerator from '@/app/_components/ApiKeyGenerator';
24
import { InterwebWtfApiKey } from '@/types';
3-
import ApiKeyGenerator from '../ApiKeyGenerator';
45

56
export interface DeveloperSettingsTabProps {
67
keys: InterwebWtfApiKey[];
@@ -11,6 +12,13 @@ export default function DeveloperSettingsTab({ keys = [] }: DeveloperSettingsTab
1112
<Box p="md">
1213
<Stack h="100%" w="100%">
1314
<Title order={2}>Developer Settings</Title>
15+
<Text>
16+
Manage your{' '}
17+
<Anchor component={Link} href="/docs">
18+
API
19+
</Anchor>{' '}
20+
keys.
21+
</Text>
1422
<ApiKeyGenerator keys={keys} />
1523
</Stack>
1624
</Box>

src/app/_components/Footer/index.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ import InterstitialCheckbox from '@/app/_components/InterstitialCheckbox';
55

66
export default function Footer() {
77
return (
8-
<Center w="100%" mb="auto" pt="xl" pb="sm" pos="relative" bottom={0}>
8+
<Center w="100%" pt="xl" pb="sm" mt="auto">
99
<Stack justify="center" align="center" w="100%">
1010
<InterstitialCheckbox />
11-
<Group align="center" justify="center">
11+
<Group align="center" w="100%" justify="flex-start">
12+
<Anchor href="/docs" component={Link} c="gray" size="sm">
13+
API
14+
</Anchor>
1215
<Anchor href="/about" component={Link} c="gray" size="sm">
1316
About
1417
</Anchor>
@@ -21,12 +24,11 @@ export default function Footer() {
2124
Interweb Alchemy
2225
</Anchor>
2326
</Text>
24-
</Group>
25-
<Group w="100%" justify="end">
2627
<Anchor
2728
href="https://github.com/InterwebAlchemy/interweb.wtf"
2829
c="gray"
2930
title="View the source code on GitHub"
31+
ml="auto"
3032
>
3133
<IconBrandGithub size={18} />
3234
</Anchor>

src/app/_components/GeneralSettingsTab/index.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
1-
import { Box, Code, Stack, Text, Title } from '@mantine/core';
1+
import Link from 'next/link';
2+
import { Anchor, Box, Code, Stack, Text, Title } from '@mantine/core';
23

34
export default function GeneralSettingsTab() {
45
return (
56
<Box p="md">
67
<Stack h="100%" w="100%">
78
<Title order={2}>Settings</Title>
8-
<Text>More settings are coming soon, but for now you can use the <Code>Developer</Code> section to generate API Keys for use with <Code>/cli</Code> endpoints that you can use programmatically.</Text>
9-
<Text>If you'd like to delete your account, that's in the <Code>Danger Zone</Code>.</Text>
9+
<Text>
10+
More settings are coming soon, but for now you can use the <Code>Developer</Code> section
11+
to generate{' '}
12+
<Anchor href="/docs" component={Link}>
13+
API
14+
</Anchor>{' '}
15+
Keys for use with <Code>/cli</Code> endpoints that you can use programmatically.
16+
</Text>
17+
<Text>
18+
If you'd like to delete your account, that's in the <Code>Danger Zone</Code>.
19+
</Text>
1020
</Stack>
1121
</Box>
1222
);

src/app/_components/Nav/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { signOut } from '@/app/_services/github/auth';
2525
const links = [
2626
{ link: '/dashboard', label: 'Dashboard' },
2727
{ link: '/is', label: 'Expander' },
28+
{ link: '/docs', label: 'Documentation' },
2829
{ link: '/settings', label: 'Settings' },
2930
];
3031

src/app/_components/Screen/index.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { redirect, RedirectType } from 'next/navigation';
2-
import { Container, Stack, Title, type TitleProps } from '@mantine/core';
2+
import { Flex, Stack, Title, type TitleProps } from '@mantine/core';
33
import { Notifications } from '@mantine/notifications';
44
import { createClient } from '@/app/_adapters/supabase/server';
55
import Footer from '@/app/_components/Footer';
@@ -33,10 +33,18 @@ export default async function Screen({
3333
return (
3434
<>
3535
<Notifications position="bottom-right" />
36-
<Container fluid h="100%" p="lg" display="flex" w="100%">
36+
<Flex
37+
h="100%"
38+
p="lg"
39+
w="100%"
40+
direction="column"
41+
justify="flex-start"
42+
align="flex-start"
43+
mih="100vh"
44+
>
3745
<Stack h="100%" w="100%">
3846
<Nav />
39-
<Stack h="100%" w="100%">
47+
<Stack w="100%">
4048
{title ? (
4149
<Title order={1} {...titleProps} mb={40}>
4250
{title}
@@ -48,7 +56,7 @@ export default async function Screen({
4856
</Stack>
4957
<Footer />
5058
</Stack>
51-
</Container>
59+
</Flex>
5260
</>
5361
);
5462
}

src/app/cli/go/[slug]/json/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@ export async function GET(_request: NextRequest, { params }: { params: Promise<R
2222

2323
return new NextResponse(JSON.stringify({ url }), {
2424
status: 200,
25+
headers: {
26+
'content-type': 'application/json',
27+
},
2528
});
2629
}

src/app/cli/go/[slug]/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@ export async function GET(_request: NextRequest, { params }: { params: Promise<R
2222

2323
return new NextResponse(url, {
2424
status: 200,
25+
headers: {
26+
'content-type': 'text/plain',
27+
},
2528
});
2629
}

src/app/cli/go/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@ export async function GET(request: NextRequest) {
2020

2121
return new NextResponse(json ? JSON.stringify({ url }) : url, {
2222
status: 200,
23+
headers: {
24+
'content-type': json ? 'application/json' : 'text/plain',
25+
},
2326
});
2427
}

0 commit comments

Comments
 (0)