-
Notifications
You must be signed in to change notification settings - Fork 1
feat : 결과보기 & 환승 경로 UI 수정 #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -44,6 +44,10 @@ | |||||
|
|
||||||
| const myRoute = routesWithColor.find((route) => route.nickname === myNickname); | ||||||
| const travelTime = myRoute?.travelTime || 0; | ||||||
|
|
||||||
|
|
||||||
| const totalTravelTime = routesWithColor.reduce((sum, route) => sum + (route.travelTime || 0), 0); | ||||||
| const averageTravelTime = routesWithColor.length > 0 ? Math.round(totalTravelTime / routesWithColor.length) : 0; | ||||||
|
|
||||||
| const extractLineNumber = (linenumber: string): string => { | ||||||
| if (!linenumber) return ''; | ||||||
|
|
@@ -96,12 +100,19 @@ | |||||
| latitude: midpoint.latitude, | ||||||
| longitude: midpoint.longitude, | ||||||
| travelTime, | ||||||
| averageTravelTime, | ||||||
| transferPath: myRoute?.transferPath || [], | ||||||
| transferPathLines, | ||||||
| userRoutes: routesWithColor, | ||||||
| }; | ||||||
| }); | ||||||
| }, [midpointData, myNickname, id]); | ||||||
|
|
||||||
| // 카테고리 텍스트 생성 함수 | ||||||
| const getCategoryText = (category: string | undefined): string => { | ||||||
| if (!category) return '밍글링 추천 1위'; | ||||||
| return `${category}이 많은 장소`; | ||||||
| }; | ||||||
|
|
||||||
| const [selectedResultId, setSelectedResultId] = useState<number>(1); | ||||||
|
|
||||||
|
|
@@ -111,7 +122,7 @@ | |||||
| router.back(); | ||||||
| }; | ||||||
|
|
||||||
| const getLineColor = (fullLineName: string) => { | ||||||
|
Check warning on line 125 in app/result/[id]/page.tsx
|
||||||
| const cleaned = fullLineName.replace('호선', '').trim(); | ||||||
| if (/^\d+$/.test(cleaned)) { | ||||||
| switch (cleaned) { | ||||||
|
|
@@ -184,8 +195,15 @@ | |||||
| <section className="border-gray-1 flex w-full flex-col gap-5 bg-white md:w-77.5 md:gap-3"> | ||||||
| <div className="px-5 pt-5 md:p-0"> | ||||||
| <div className="flex items-center justify-between"> | ||||||
| <button | ||||||
| onClick={() => router.back()} | ||||||
| className="flex items-center justify-center" | ||||||
| type="button" | ||||||
| > | ||||||
| <Image src="/icon/left_chevron.svg" alt="뒤로가기" width={24} height={24} /> | ||||||
| </button> | ||||||
| <div className="text-gray-9 text-[22px] font-semibold tracking-[-1.94%]"> | ||||||
| 최종 위치 결과 Top 3 | ||||||
| 최종 위치 결과 Top3 | ||||||
| </div> | ||||||
| <button | ||||||
| className="text-blue-5 bg-blue-1 hover:bg-blue-2 flex h-7 cursor-pointer items-center gap-1 rounded px-2.5 text-[11px] font-semibold transition-colors" | ||||||
|
|
@@ -229,75 +247,104 @@ | |||||
| </span> | ||||||
| </div> | ||||||
| ) : ( | ||||||
| locationResults.map((result) => ( | ||||||
| <div | ||||||
| key={result.id} | ||||||
| onClick={() => setSelectedResultId(result.id)} | ||||||
| className={`flex cursor-pointer flex-col gap-3.75 rounded border bg-white p-5 ${ | ||||||
| selectedResultId === result.id | ||||||
| ? 'border-blue-5 border-2' | ||||||
| : 'border-gray-2 hover:bg-gray-1' | ||||||
| }`} | ||||||
| > | ||||||
| <div className="flex items-center justify-between"> | ||||||
| <span className="text-gray-10 text-lg font-semibold"> | ||||||
| {result.endStation}역 | ||||||
| </span> | ||||||
| <span className="text-gray-6 text-[13px] font-normal"> | ||||||
| 이동시간 | ||||||
| <span className="text-blue-5 ml-1.75 text-lg font-semibold"> | ||||||
| {result.travelTime}분 | ||||||
| locationResults.map((result) => { | ||||||
| const category = meetingData?.data?.purposes?.[meetingData.data.purposes.length - 1]; | ||||||
| const categoryText = getCategoryText(category); | ||||||
|
|
||||||
| const handleRecommendClick = (e: React.MouseEvent) => { | ||||||
| e.stopPropagation(); | ||||||
| if (!id || !result.endStation) return; | ||||||
|
|
||||||
| let meetingType = ''; | ||||||
| let categoryParam = ''; | ||||||
|
|
||||||
| if (typeof window !== 'undefined') { | ||||||
| meetingType = localStorage.getItem(`meeting_${id}_meetingType`) || ''; | ||||||
| categoryParam = localStorage.getItem(`meeting_${id}_category`) || ''; | ||||||
| } | ||||||
|
|
||||||
| if (!meetingType && meetingData?.data?.purposes && meetingData.data.purposes.length > 0) { | ||||||
| meetingType = meetingData.data.purposes[0]; | ||||||
| } | ||||||
| if (!categoryParam && category) { | ||||||
| categoryParam = category; | ||||||
| } | ||||||
|
|
||||||
| const params = new URLSearchParams({ | ||||||
| meetingId: id, | ||||||
| midPlace: result.endStation, | ||||||
| lat: result.latitude.toString(), | ||||||
| lng: result.longitude.toString(), | ||||||
| }); | ||||||
|
|
||||||
| if (meetingType) params.append('meetingType', meetingType); | ||||||
| if (categoryParam) params.append('category', categoryParam); | ||||||
|
|
||||||
| router.push(`/recommend?${params.toString()}`); | ||||||
| }; | ||||||
|
|
||||||
| return ( | ||||||
| <div | ||||||
| key={result.id} | ||||||
| onClick={() => setSelectedResultId(result.id)} | ||||||
| className={`flex cursor-pointer flex-col gap-3.75 rounded-[4px] border bg-white p-5 ${ | ||||||
| selectedResultId === result.id | ||||||
| ? 'border-blue-5 border-2' | ||||||
| : 'border-gray-2 hover:bg-gray-1' | ||||||
| }`} | ||||||
| > | ||||||
|
|
||||||
| <div className="flex items-center gap-1.5"> | ||||||
| <Image src='/icon/stars.svg' alt='stars' width={16} height={16} /> | ||||||
| <span className="text-blue-5 text-sm font-medium">{categoryText}</span> | ||||||
| </div> | ||||||
|
|
||||||
|
|
||||||
| <div className="flex items-center justify-between"> | ||||||
| <span className="text-gray-10 text-xl font-bold"> | ||||||
| {result.endStation}역 | ||||||
| </span> | ||||||
| </span> | ||||||
| </div> | ||||||
|
|
||||||
| <div className="text-gray-6 flex items-center gap-3 text-[13px]"> | ||||||
| <span>내 환승경로</span> | ||||||
| </div> | ||||||
| <div className="flex items-center"> | ||||||
| {result.transferPathLines.map( | ||||||
| (line: { display: string; text: string }, idx: number) => ( | ||||||
| <div key={idx} className="flex items-center"> | ||||||
| <span | ||||||
| className={`flex h-5 w-5 items-center justify-center rounded-full text-[11px] text-white ${getLineColor(line.text)}`} | ||||||
| > | ||||||
| {line.display} | ||||||
| <div className="flex flex-col items-end "> | ||||||
| <span className="text-gray-6 text-[13px] font-regular"> | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Search for font-regular in the codebase
echo "=== Searching for font-regular definitions ==="
rg "font-regular" -n
echo -e "\n=== Looking for Tailwind config files ==="
fd "tailwind" -type f | head -20
echo -e "\n=== Checking if font-regular is used elsewhere ==="
rg "font-regular" --type jsx --type tsx -cRepository: SWYP-mingling/Frontend Length of output: 540 🏁 Script executed: #!/bin/bash
# Find and examine tailwind config file
config_file=$(fd "tailwind.config" | head -1)
if [ -n "$config_file" ]; then
echo "=== Tailwind Config Content ==="
cat -n "$config_file"
fiRepository: SWYP-mingling/Frontend Length of output: 48 🏁 Script executed: #!/bin/bash
# Check the specific file and surrounding context
if [ -f "app/result/\[id\]/page.tsx" ]; then
echo "=== Checking app/result/[id]/page.tsx around line 308 ==="
sed -n '300,320p' "app/result/\[id\]/page.tsx" | cat -n
fiRepository: SWYP-mingling/Frontend Length of output: 48 🏁 Script executed: #!/bin/bash
# Read the actual page.tsx file with proper path
cat -n "app/result/[id]/page.tsx" | sed -n '300,320p'
echo -e "\n=== Look for tailwind config in common locations ==="
ls -la | grep -i tailwind
ls -la | grep -i configRepository: SWYP-mingling/Frontend Length of output: 1580 🏁 Script executed: #!/bin/bash
# Check package.json for tailwind config
cat package.json | grep -A 20 -B 5 tailwind
echo -e "\n=== Check for global CSS or styles ==="
fd "\\.css" -type f | head -20Repository: SWYP-mingling/Frontend Length of output: 1122 🏁 Script executed: #!/bin/bash
# Search for any font-weight or font customization
rg "font-weight|'font'|\"font\"" --type=json | head -30Repository: SWYP-mingling/Frontend Length of output: 48 🏁 Script executed: #!/bin/bash
# Check postcss and next config
echo "=== postcss.config.mjs ==="
cat postcss.config.mjs
echo -e "\n=== next.config.ts ==="
cat next.config.ts
echo -e "\n=== Search for CSS files ==="
find . -name "*.css" -type f | grep -v node_modules | head -20Repository: SWYP-mingling/Frontend Length of output: 992 🏁 Script executed: #!/bin/bash
# Check for globals.css and any custom font definitions
find . -name "globals.css" -o -name "global.css" -o -name "app.css" | grep -v node_modules | while read file; do
echo "=== Found: $file ==="
cat -n "$file"
doneRepository: SWYP-mingling/Frontend Length of output: 2849 🏁 Script executed: #!/bin/bash
# Search for any font customization in CSS or config files
rg "font-regular|font-normal|font-weight" --glob="*.css" --glob="*.ts" --glob="*.js" | grep -v node_modules | head -30Repository: SWYP-mingling/Frontend Length of output: 48
표준 Tailwind CSS v4에서 🐛 수정 제안- <span className="text-gray-6 text-[13px] font-regular">
+ <span className="text-gray-6 text-[13px] font-normal">📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| 평균 이동시간{' '} | ||||||
| <span className="text-blue-5 text-[18px] font-bold"> | ||||||
| {result.averageTravelTime}분 | ||||||
| </span> | ||||||
| <span className="text-gray-10 ml-1 text-sm font-semibold"> | ||||||
| {line.text} | ||||||
| </span> | ||||||
| {idx < result.transferPathLines.length - 1 && ( | ||||||
| <Image | ||||||
| src="/icon/rightarrow.svg" | ||||||
| alt="화살표" | ||||||
| width={13} | ||||||
| height={22} | ||||||
| className="text-gray-6 mx-1.75 w-auto" | ||||||
| /> | ||||||
| )} | ||||||
| </div> | ||||||
| ) | ||||||
| )} | ||||||
| </span> | ||||||
|
|
||||||
| </div> | ||||||
| </div> | ||||||
|
|
||||||
|
|
||||||
| <div className="flex gap-2"> | ||||||
| <button | ||||||
| onClick={handleRecommendClick} | ||||||
| className="bg-gray-8 hover:bg-gray-9 flex-1 h-10 cursor-pointer rounded-[4px] text-[15px] font-normal text-white transition-colors" | ||||||
| type="button" | ||||||
| > | ||||||
| 주변 장소 추천 | ||||||
| </button> | ||||||
| <button | ||||||
| onClick={(e) => { | ||||||
| e.stopPropagation(); | ||||||
| openModal( | ||||||
| 'TRANSFER', | ||||||
| { meetingId: id, | ||||||
| userRoutes: result.userRoutes, | ||||||
| endStation: result.endStation, | ||||||
| }, | ||||||
| e | ||||||
| ); | ||||||
| }} | ||||||
| className="bg-gray-1 hover:bg-gray-2 flex-1 h-10 cursor-pointer rounded-[4px] text-[15px] font-normal text-blue-5 transition-colors" | ||||||
| type="button" | ||||||
| > | ||||||
| 환승 경로 보기 | ||||||
| </button> | ||||||
| </div> | ||||||
| </div> | ||||||
|
|
||||||
| <button | ||||||
| onClick={(e) => { | ||||||
| e.stopPropagation(); | ||||||
| openModal( | ||||||
| 'TRANSFER', | ||||||
| { | ||||||
| userRoutes: result.userRoutes, | ||||||
| endStation: result.endStation, | ||||||
| }, | ||||||
| e | ||||||
| ); | ||||||
| }} | ||||||
| className="bg-gray-8 h-8 w-full cursor-pointer rounded py-1 text-[15px] font-normal text-white" | ||||||
| > | ||||||
| 모임원 환승경로 보기 | ||||||
| </button> | ||||||
| </div> | ||||||
| )) | ||||||
| ); | ||||||
| }) | ||||||
| )} | ||||||
| </div> | ||||||
| </div> | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getCategoryText에서 한국어 조사 처리가 누락되었습니다."${category}이 많은 장소"는 카테고리가 받침으로 끝나는 경우(예: "식당이")에는 맞지만, 받침이 없는 경우(예: "카페")에는 "카페가 많은 장소"가 자연스럽습니다. 조사 "이/가"를 받침 유무에 따라 분기해야 합니다.♻️ 조사 처리 제안
const getCategoryText = (category: string | undefined): string => { if (!category) return '밍글링 추천 1위'; - return `${category}이 많은 장소`; + const lastChar = category.charCodeAt(category.length - 1); + const hasJongseong = (lastChar - 0xAC00) % 28 !== 0; + return `${category}${hasJongseong ? '이' : '가'} 많은 장소`; };📝 Committable suggestion
🤖 Prompt for AI Agents