Skip to content

Commit 5a85b31

Browse files
authored
Merge pull request #40 from dev-five-git/fix-landing
Fix test case counting on landing
2 parents 422b36c + 3aaea0c commit 5a85b31

6 files changed

Lines changed: 980 additions & 951 deletions

File tree

apps/landing/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12-
"@devup-ui/react": "^1.0.2",
12+
"@devup-ui/react": "^1.0.15",
1313
"@mdx-js/loader": "^3.1.0",
1414
"@mdx-js/react": "^3.1.0",
15-
"@next/mdx": "^15.3.3",
15+
"@next/mdx": "^15.5.0",
1616
"@types/mdx": "^2.0.13",
1717
"braillify": "workspace:*",
18-
"next": "15.3.3",
19-
"react": "^19.1.0",
20-
"react-dom": "^19.1.0",
18+
"next": "15.5.0",
19+
"react": "^19.1.1",
20+
"react-dom": "^19.1.1",
2121
"react-latex-next": "^3.0.0",
2222
"react-syntax-highlighter": "15.6.1"
2323
},
2424
"devDependencies": {
25-
"@devup-ui/next-plugin": "^1.0.2",
25+
"@devup-ui/next-plugin": "^1.0.30",
2626
"@types/node": "^24",
2727
"@types/react": "^19",
2828
"@types/react-dom": "^19",

apps/landing/src/app/TransInput.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
'use client'
22

3-
import { Box, DevupProps, Flex, Input, Text } from '@devup-ui/react'
3+
import { Box, Flex, Input, Text } from '@devup-ui/react'
44
import { useEffect, useRef, useState } from 'react'
55

6-
import { Merge } from '@/types'
7-
86
export function TransInput({
97
blurPlaceholder,
108
focusPlaceholder,
@@ -14,7 +12,7 @@ export function TransInput({
1412
blurPlaceholder: string
1513
focusPlaceholder: string
1614
isFocused?: boolean
17-
} & Merge<React.ComponentProps<'textarea'>, DevupProps<'textarea'>>) {
15+
} & React.ComponentProps<'textarea'>) {
1816
const [boxHeight, setBoxHeight] = useState(0)
1917
const placeholderRef = useRef<HTMLSpanElement>(null)
2018

apps/landing/src/app/test-case/page.tsx

Lines changed: 64 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,67 @@ export default async function TestCasePage() {
3333
JSON.parse(data),
3434
) as Promise<Record<string, { title: string; description: string }>>,
3535
])
36+
let totalTest = 0
37+
let totalFail = 0
38+
const cases = Object.entries(ruleMap).map(([key, value]) => {
39+
totalTest += testStatus[key][0]
40+
totalFail += testStatus[key][1]
41+
return (
42+
<VStack
43+
key={key}
44+
flex="1"
45+
gap={['30px', null, null, '40px']}
46+
px={['16px', null, null, '60px']}
47+
py={['30px', null, null, '40px']}
48+
>
49+
<VStack gap="20px">
50+
<Text color="$title" typography="docsTitle">
51+
{value.title} ({testStatus[key][0] - testStatus[key][1]}/
52+
{testStatus[key][0]})
53+
</Text>
54+
<Text color="$text" typography="body">
55+
{value.description}
56+
</Text>
57+
</VStack>
58+
<Box bg="$text" h="1px" />
59+
<Grid
60+
gap="8px"
61+
gridTemplateColumns="repeat(auto-fill, minmax(16px, 1fr))"
62+
>
63+
{testStatus[key][2].map(
64+
([text, expected, actual, isSuccess], idx) => {
65+
const textParts = parseTextWithLaTeX(text)
66+
67+
return (
68+
<TestCaseCircle key={text + idx} isSuccess={isSuccess}>
69+
<Text
70+
color="#FFF"
71+
typography="body"
72+
whiteSpace="nowrap"
73+
wordBreak="keep-all"
74+
>
75+
{textParts.map((part, partIdx) =>
76+
part.type === 'latex' ? (
77+
<Latex key={partIdx}>${part.content}$</Latex>
78+
) : (
79+
<span key={partIdx}>{part.content}</span>
80+
),
81+
)}
82+
<br />
83+
정답 : {expected}
84+
<br />
85+
결과 : {actual}
86+
<br />
87+
{isSuccess ? '✅ 테스트 성공' : '❌ 테스트 실패'}
88+
</Text>
89+
</TestCaseCircle>
90+
)
91+
},
92+
)}
93+
</Grid>
94+
</VStack>
95+
)
96+
})
3697

3798
return (
3899
<Box maxW="1920px" mx="auto" pb="100px" w="100%">
@@ -42,7 +103,8 @@ export default async function TestCasePage() {
42103
py={['30px', null, null, '40px']}
43104
>
44105
<Text color="$title" typography="title">
45-
테스트 케이스
106+
테스트 케이스 ({(totalTest - totalFail).toLocaleString()}/
107+
{totalTest.toLocaleString()})
46108
</Text>
47109
<Text color="$text" typography="body">
48110
모든 테스트 케이스는{' '}
@@ -60,63 +122,7 @@ export default async function TestCasePage() {
60122
을 기반으로 작성되었습니다.
61123
</Text>
62124
</VStack>
63-
{Object.entries(ruleMap).map(([key, value]) => {
64-
return (
65-
<VStack
66-
key={key}
67-
flex="1"
68-
gap={['30px', null, null, '40px']}
69-
px={['16px', null, null, '60px']}
70-
py={['30px', null, null, '40px']}
71-
>
72-
<VStack gap="20px">
73-
<Text color="$title" typography="docsTitle">
74-
{value.title} ({testStatus[key][0]}/
75-
{testStatus[key][1] + testStatus[key][0]})
76-
</Text>
77-
<Text color="$text" typography="body">
78-
{value.description}
79-
</Text>
80-
</VStack>
81-
<Box bg="$text" h="1px" />
82-
<Grid
83-
gap="8px"
84-
gridTemplateColumns="repeat(auto-fill, minmax(16px, 1fr))"
85-
>
86-
{testStatus[key][2].map(
87-
([text, expected, actual, isSuccess], idx) => {
88-
const textParts = parseTextWithLaTeX(text)
89-
90-
return (
91-
<TestCaseCircle key={text + idx} isSuccess={isSuccess}>
92-
<Text
93-
color="#FFF"
94-
typography="body"
95-
whiteSpace="nowrap"
96-
wordBreak="keep-all"
97-
>
98-
{textParts.map((part, partIdx) =>
99-
part.type === 'latex' ? (
100-
<Latex key={partIdx}>${part.content}$</Latex>
101-
) : (
102-
<span key={partIdx}>{part.content}</span>
103-
),
104-
)}
105-
<br />
106-
정답 : {expected}
107-
<br />
108-
결과 : {actual}
109-
<br />
110-
{isSuccess ? '✅ 테스트 성공' : '❌ 테스트 실패'}
111-
</Text>
112-
</TestCaseCircle>
113-
)
114-
},
115-
)}
116-
</Grid>
117-
</VStack>
118-
)
119-
})}
125+
{cases}
120126
</Box>
121127
)
122128
}

apps/landing/src/components/home/PillButton.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import { Box, Button, DevupProps, Flex } from '@devup-ui/react'
1+
import { Box, Button, Flex } from '@devup-ui/react'
22
import Link from 'next/link'
33
import { HTMLAttributeAnchorTarget } from 'react'
44

5-
import { Merge } from '@/types'
6-
75
export default function PillButton({
86
href,
97
target = '_self',
@@ -13,7 +11,7 @@ export default function PillButton({
1311
href: string
1412
target?: HTMLAttributeAnchorTarget
1513
children: React.ReactNode
16-
props?: Merge<React.ComponentProps<typeof Button>, DevupProps<typeof Button>>
14+
props?: React.ComponentProps<typeof Button>
1715
}) {
1816
return (
1917
<Link

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
"devDependencies": {
1515
"braillify": "workspace:*",
1616
"eslint-plugin-devup": "^2.0.5",
17-
"eslint": "^9.28.0",
18-
"vitest": "^3.2.3",
19-
"@vitest/coverage-v8": "^3.2.3",
20-
"@changesets/cli": "^2.29.4",
21-
"@types/node": "^24.0.0",
22-
"vite-plugin-wasm": "^3.4.1"
17+
"eslint": "^9.33.0",
18+
"vitest": "^3.2.4",
19+
"@vitest/coverage-v8": "^3.2.4",
20+
"@changesets/cli": "^2.29.6",
21+
"@types/node": "^24.3.0",
22+
"vite-plugin-wasm": "^3.5.0"
2323
},
2424
"author": "devfive",
25-
"packageManager": "pnpm@10.12.1",
25+
"packageManager": "pnpm@10.15.0",
2626
"resolutions": {
2727
"vite": "^6"
2828
}

0 commit comments

Comments
 (0)