Skip to content

Commit db8bb6a

Browse files
committed
Make test case filter ui sticky
1 parent c8d5868 commit db8bb6a

3 files changed

Lines changed: 18 additions & 20 deletions

File tree

apps/landing/src/app/layout.tsx

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Box, css, globalCss, ThemeScript } from '@devup-ui/react'
1+
import { Box, globalCss, ThemeScript } from '@devup-ui/react'
22
import type { Metadata } from 'next'
33

44
import Footer from '@/components/Footer'
@@ -52,13 +52,21 @@ globalCss({
5252
maxWidth: '100vw',
5353
overflowX: 'hidden',
5454
},
55+
body: {
56+
maxHeight: '100vh',
57+
background: '#373634',
58+
WebkitFontSmoothing: 'antialiased',
59+
MozOsxFontSmoothing: 'grayscale',
60+
fontFamily: 'Spoqa Han Sans Neo, Arial, Helvetica, sans-serif',
61+
},
5562
'*': {
5663
boxSizing: 'border-box',
5764
padding: 0,
5865
margin: 0,
5966
},
6067
a: {
6168
color: 'var(--link)',
69+
textDecoration: 'none',
6270
},
6371
'::placeholder': {
6472
fontFamily: 'Spoqa Han Sans Neo, Arial, Helvetica, sans-serif',
@@ -86,22 +94,7 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
8694
<ThemeScript auto />
8795
<link href="/favicon.svg" rel="shortcut icon" />
8896
</head>
89-
<body
90-
className={css({
91-
background: '#373634',
92-
WebkitFontSmoothing: 'antialiased',
93-
MozOsxFontSmoothing: 'grayscale',
94-
fontFamily: 'Spoqa Han Sans Neo, Arial, Helvetica, sans-serif',
95-
selectors: {
96-
'& a': {
97-
textDecoration: 'none',
98-
},
99-
'& *::placeholder': {
100-
fontFamily: 'Spoqa Han Sans Neo, Arial, Helvetica, sans-serif',
101-
},
102-
},
103-
})}
104-
>
97+
<body>
10598
<noscript>
10699
<iframe
107100
height="0"
@@ -110,7 +103,7 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
110103
width="0"
111104
/>
112105
</noscript>
113-
<Box bg="$background">
106+
<Box bg="$background" pos="relative">
114107
<Header />
115108
{children}
116109
</Box>

apps/landing/src/components/Header/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,16 @@ export default function Header() {
2727
const pathname = usePathname()
2828

2929
const isIntersectingHome = pathname === '/' && isIntersecting
30+
const isTestCase = pathname === '/test-case'
3031

3132
return (
3233
<>
3334
<Box
35+
bg={isTestCase ? '$background' : 'transparent'}
3436
h={['60px', null, null, '100px']}
3537
left="0"
3638
p={['4px', null, null, '10px']}
37-
position="fixed"
39+
position="sticky"
3840
right="0"
3941
top="0"
4042
w="100%"
@@ -159,7 +161,7 @@ export default function Header() {
159161
</Flex>
160162
</Flex>
161163
</Box>
162-
<Box ref={headerRef} h={['60px', null, null, '100px']} />
164+
<Box ref={headerRef} h="0" />
163165
<Suspense>
164166
<MobileMenu />
165167
</Suspense>

apps/landing/src/components/test-case/TestCaseFilterContainer.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ export function TestCaseFilterContainer({
1313
const isList = options.type === 'list'
1414
return (
1515
<VStack
16+
bg="$background"
1617
gap="12px"
1718
mb={[isList ? '30px' : '40px', null, null, '40px']}
19+
pos="sticky"
1820
px={['16px', null, null, '60px']}
21+
top="100px"
1922
>
2023
{children}
2124
</VStack>

0 commit comments

Comments
 (0)