Skip to content

Commit 6a56a51

Browse files
committed
Fix warning
1 parent f2d87cb commit 6a56a51

26 files changed

Lines changed: 130 additions & 128 deletions

File tree

apps/landing/src/app/(detail)/components/MdxCard.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ export default async function MdxCard({
2929
)
3030
// extract comment
3131
const comment = content.match(/\/\*\*[\s\S]*?\*\//)?.[0]
32-
const code = content.replace('\n' + comment!, '')
32+
const code = comment ? content.replace(`\n${comment}`, '') : content
33+
const markdownComponents = _components as React.ComponentProps<
34+
typeof ReactMarkdown
35+
>['components']
3336
const normalizedCode = code
3437
.split('\n')
3538
.map((line) => line.replaceAll(' ', ' '))
@@ -64,7 +67,7 @@ export default async function MdxCard({
6467
>
6568
<VStack gap="30px" px="24px" py="32px">
6669
<Box>{demo}</Box>
67-
<ReactMarkdown components={_components as any}>
70+
<ReactMarkdown components={markdownComponents}>
6871
{normalizedComment ?? ''}
6972
</ReactMarkdown>
7073
</VStack>

apps/landing/src/app/(detail)/components/MdxCardFooter.tsx

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -63,41 +63,39 @@ export default function MdxCardFooter({
6363
transition="grid-template-rows 0.3s ease-in-out"
6464
>
6565
{isOpen && (
66-
<>
67-
<Box pos="absolute" w="100%">
68-
<Center
69-
_active={{
70-
borderColor: '$primary',
71-
bg: '$menuActive',
72-
}}
73-
_hover={{
74-
borderColor: '$primary',
75-
bg: '$menuHover',
76-
}}
77-
bg="$containerBackground"
78-
border="1px solid transparent"
79-
borderRadius="4px"
80-
boxShadow="0 2px 6px 0 $shadow"
81-
cursor="pointer"
82-
gap="8px"
83-
onClick={handleCopy}
84-
p="8px"
85-
pos="absolute"
86-
right="16px"
87-
top="16px"
88-
transition="all 0.125s ease-in-out"
89-
>
90-
<Image
91-
aspectRatio="1"
92-
boxSize="20px"
93-
src={copied ? '/icons/copied.svg' : '/icons/copy-code.svg'}
94-
/>
95-
<Text color="$captionBold" typography="caption">
96-
Copy
97-
</Text>
98-
</Center>
99-
</Box>
100-
</>
66+
<Box pos="absolute" w="100%">
67+
<Center
68+
_active={{
69+
borderColor: '$primary',
70+
bg: '$menuActive',
71+
}}
72+
_hover={{
73+
borderColor: '$primary',
74+
bg: '$menuHover',
75+
}}
76+
bg="$containerBackground"
77+
border="1px solid transparent"
78+
borderRadius="4px"
79+
boxShadow="0 2px 6px 0 $shadow"
80+
cursor="pointer"
81+
gap="8px"
82+
onClick={handleCopy}
83+
p="8px"
84+
pos="absolute"
85+
right="16px"
86+
top="16px"
87+
transition="all 0.125s ease-in-out"
88+
>
89+
<Image
90+
aspectRatio="1"
91+
boxSize="20px"
92+
src={copied ? '/icons/copied.svg' : '/icons/copy-code.svg'}
93+
/>
94+
<Text color="$captionBold" typography="caption">
95+
Copy
96+
</Text>
97+
</Center>
98+
</Box>
10199
)}
102100
<Box
103101
borderTop={isOpen ? '1px solid $border' : 'none'}

apps/landing/src/app/(detail)/components/[component]/IconDelete.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { css } from '@devup-ui/react'
33
export default function IconDelete() {
44
return (
55
<svg
6+
aria-hidden="true"
67
className={css({ transform: 'scale(0.75)' })}
78
fill="currentColor"
89
height="24"

apps/landing/src/app/(detail)/components/[component]/button/demo/2_Icon.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export default function Icon() {
1515
className={css({ h: 'min-content' })}
1616
icon={
1717
<svg
18+
aria-hidden="true"
1819
fill="none"
1920
height="24"
2021
viewBox="0 0 24 24"
@@ -37,6 +38,7 @@ export default function Icon() {
3738
className={css({ h: 'min-content' })}
3839
icon={
3940
<svg
41+
aria-hidden="true"
4042
fill="none"
4143
height="24"
4244
viewBox="0 0 25 24"

apps/landing/src/app/(detail)/components/[component]/textbox/demo/2_Error.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Input } from '@devup-ui/components'
44
* **Error**
55
* Use `error` prop to display the input in an error state with a red border. Use `errorMessage` prop to show a validation message below the input.
66
*/
7-
export default function Error() {
7+
export default function ErrorDemo() {
88
return (
99
<Input
1010
error

apps/landing/src/app/(detail)/components/[component]/textbox/demo/4_Icon.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Input } from '@devup-ui/components'
33
function SearchIcon() {
44
return (
55
<svg
6+
aria-hidden="true"
67
fill="none"
78
height="20"
89
viewBox="0 0 20 20"

apps/landing/src/app/(detail)/docs/OpenMenuItem.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Link from 'next/link'
44
import { usePathname } from 'next/navigation'
55
import { Fragment, useReducer } from 'react'
66

7-
import { MenuItemProps } from './MenuItem'
7+
import type { MenuItemProps } from './MenuItem'
88

99
export function OpenMenuItem({
1010
children,
@@ -52,10 +52,12 @@ export function OpenMenuItem({
5252
<Flex gap="8px">
5353
<Box borderRight="1px solid var(--border, #E0E0E0)" w="10px" />
5454
<VStack flex="1" gap="4px">
55-
{subMenu.map(({ children, to }, idx) => {
55+
{subMenu.map(({ children, to }) => {
5656
const selected = to ? path.startsWith(to) : false
57+
const key = to ?? String(children)
5758
const inner = (
5859
<Flex
60+
key={key}
5961
_hover={{
6062
bg: '$menuHover',
6163
}}
@@ -81,7 +83,7 @@ export function OpenMenuItem({
8183

8284
return to ? (
8385
<Link
84-
key={idx}
86+
key={key}
8587
className={css({
8688
textDecoration: 'none',
8789
})}
@@ -90,7 +92,7 @@ export function OpenMenuItem({
9092
{inner}
9193
</Link>
9294
) : (
93-
<Fragment key={idx}>{inner}</Fragment>
95+
<Fragment key={key}>{inner}</Fragment>
9496
)
9597
})}
9698
</VStack>

apps/landing/src/app/(detail)/docs/RightIndex.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function RightIndex() {
6262

6363
setMenus(
6464
[...elements].map((element) => ({
65-
text: element.textContent!,
65+
text: element.textContent ?? '',
6666
sub:
6767
element.tagName === 'H3' ||
6868
element.tagName === 'H4' ||
@@ -91,7 +91,7 @@ export function RightIndex() {
9191
clearTimeout(timeoutId)
9292
observer.disconnect()
9393
}
94-
}, [pathname])
94+
}, [])
9595

9696
return (
9797
<VStack gap="16px" p="20px 16px" w="200px">
@@ -101,12 +101,8 @@ export function RightIndex() {
101101
Contents
102102
</Text>
103103
</Flex>
104-
{menus.map((menu, idx) => (
105-
<IndexMenu
106-
key={menu.text + idx}
107-
onClick={menu.onClick}
108-
sub={menu.sub}
109-
>
104+
{menus.map((menu) => (
105+
<IndexMenu key={menu.text} onClick={menu.onClick} sub={menu.sub}>
110106
{menu.text}
111107
</IndexMenu>
112108
))}
@@ -135,6 +131,7 @@ export function RightIndex() {
135131
Edit this page
136132
</Text>
137133
<svg
134+
aria-hidden="true"
138135
className={css({
139136
color: '$caption',
140137
_groupHover: { color: '$text' },

apps/landing/src/app/(detail)/docs/layout.tsx

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,26 @@ export default function DetailLayout({
99
children: React.ReactNode
1010
}>) {
1111
return (
12-
<>
13-
<Flex maxW="1920px" minH="calc(100vh - 500px)" mx="auto">
14-
<Box display={['none', null, 'initial']} p="20px 16px" w="220px">
15-
<Box pos="sticky" top={['70px', null, '90px']}>
16-
<LeftMenu />
17-
</Box>
12+
<Flex maxW="1920px" minH="calc(100vh - 500px)" mx="auto">
13+
<Box display={['none', null, 'initial']} p="20px 16px" w="220px">
14+
<Box pos="sticky" top={['70px', null, '90px']}>
15+
<LeftMenu />
1816
</Box>
19-
<Box
20-
className="markdown-body"
21-
flex={1}
22-
px={['20px', null, '60px']}
23-
py={['20px', null, '40px']}
24-
w="100%"
25-
>
26-
{children}
17+
</Box>
18+
<Box
19+
className="markdown-body"
20+
flex={1}
21+
px={['20px', null, '60px']}
22+
py={['20px', null, '40px']}
23+
w="100%"
24+
>
25+
{children}
26+
</Box>
27+
<Box display={['none', null, null, null, null, 'initial']}>
28+
<Box pos="sticky" top={['50px', null, '70px']}>
29+
<RightIndex />
2730
</Box>
28-
<Box display={['none', null, null, null, null, 'initial']}>
29-
<Box pos="sticky" top={['50px', null, '70px']}>
30-
<RightIndex />
31-
</Box>
32-
</Box>
33-
</Flex>
34-
</>
31+
</Box>
32+
</Flex>
3533
)
3634
}

apps/landing/src/app/(detail)/team/layout.tsx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@ export default function TeamLayout({
66
children: React.ReactNode
77
}>) {
88
return (
9-
<>
10-
<Box
11-
maxW="1014px"
12-
minH="calc(100vh - 500px)"
13-
mx="auto"
14-
px={['16px', null, '60px']}
15-
py={['20px', null, '40px']}
16-
>
17-
{children}
18-
</Box>
19-
</>
9+
<Box
10+
maxW="1014px"
11+
minH="calc(100vh - 500px)"
12+
mx="auto"
13+
px={['16px', null, '60px']}
14+
py={['20px', null, '40px']}
15+
>
16+
{children}
17+
</Box>
2018
)
2119
}

0 commit comments

Comments
 (0)