Skip to content

Commit 7bd424b

Browse files
committed
site: various layout
1 parent ec16215 commit 7bd424b

File tree

5 files changed

+33
-26
lines changed

5 files changed

+33
-26
lines changed

assets/brand.sketch

10.2 KB
Binary file not shown.

packages/site/components/Container.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ export const Container = (props: StackProps) => {
88
px="$4"
99
width="100%"
1010
$gtSm={{
11-
maxWidth: 720,
11+
maxWidth: 700,
1212
}}
1313
$gtMd={{
14-
maxWidth: 720,
14+
maxWidth: 700,
1515
}}
1616
{...props}
1717
/>

packages/site/components/DocsPage.tsx

+5-9
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ import { ExternalIcon } from './ExternalIcon'
1616
import { Link } from './Link'
1717
import { NavHeading } from './NavHeading'
1818

19-
const DocsPageContainer = (props: StackProps) => (
20-
<Container $gtSm={{ maxWidth: 780 }} $gtMd={{ maxWidth: 780 }} {...props} />
21-
)
22-
2319
export function DocsPage({ children }: { children: React.ReactNode }) {
2420
const router = useRouter()
2521
const [isOpen, setIsOpen] = React.useState(false)
@@ -169,9 +165,9 @@ export function DocsPage({ children }: { children: React.ReactNode }) {
169165
<YStack $sm={{ display: 'none' }} position="absolute" top={15} right={20}>
170166
<AlphaButton />
171167
</YStack>
172-
<DocsPageContainer>{children}</DocsPageContainer>
168+
<Container>{children}</Container>
173169

174-
<DocsPageContainer>
170+
<Container>
175171
{(previous || next) && (
176172
<XStack aria-label="Pagination navigation" my="$9" jc="space-between" space>
177173
{previous && (
@@ -230,9 +226,9 @@ export function DocsPage({ children }: { children: React.ReactNode }) {
230226
)}
231227
</XStack>
232228
)}
233-
</DocsPageContainer>
229+
</Container>
234230

235-
<DocsPageContainer my="$3">
231+
<Container my="$3">
236232
<Link
237233
href={editUrl}
238234
title="Edit this page on GitHub."
@@ -241,7 +237,7 @@ export function DocsPage({ children }: { children: React.ReactNode }) {
241237
>
242238
Edit this page on GitHub.
243239
</Link>
244-
</DocsPageContainer>
240+
</Container>
245241
</YStack>
246242
</YStack>
247243
</DocsPageTheme>

packages/site/components/Link.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ export const Link = ({
1515
}: LinkProps) => {
1616
return (
1717
<NextLink passHref {...{ href, replace, scroll, shallow, prefetch, locale }}>
18-
<Paragraph tag="a" color="$color3" hoverStyle={{ color: '$color' }} {...props} />
18+
<Paragraph
19+
cursor="pointer"
20+
tag="a"
21+
color="$color3"
22+
hoverStyle={{ color: '$color' }}
23+
{...props}
24+
/>
1925
</NextLink>
2026
)
2127
}

packages/site/components/QuickNav.tsx

+19-14
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1+
import NextLink from 'next/link'
12
import React, { useEffect, useState } from 'react'
23
import { ScrollView } from 'react-native'
34
import { RemoveScroll } from 'react-remove-scroll'
4-
import { H4, Spacer, YStack } from 'tamagui'
5+
import { H4, Paragraph, YStack } from 'tamagui'
56

6-
import { Link, LinkProps } from './Link'
7+
import { LinkProps } from './Link'
78

8-
const QuickNavLink = (props: LinkProps) => (
9-
<Link
10-
size="$2"
11-
fontSize="$2"
12-
opacity={0.5}
13-
color="$color"
14-
py={3}
15-
hoverStyle={{
16-
opacity: 1,
17-
}}
18-
{...props}
19-
/>
9+
const QuickNavLink = ({ href, ...rest }: LinkProps) => (
10+
<NextLink passHref href={href}>
11+
<Paragraph
12+
tag="a"
13+
size="$2"
14+
fontSize="$2"
15+
opacity={0.5}
16+
color="$color"
17+
cursor="pointer"
18+
py="$1"
19+
hoverStyle={{
20+
opacity: 1,
21+
}}
22+
{...rest}
23+
/>
24+
</NextLink>
2025
)
2126

2227
export function QuickNav() {

0 commit comments

Comments
 (0)