Skip to content

feat#29-mainpage-ui#37

Merged
Dobbymin merged 23 commits intomainfrom
feat#29-mainpage-ui
Aug 21, 2025
Merged

feat#29-mainpage-ui#37
Dobbymin merged 23 commits intomainfrom
feat#29-mainpage-ui

Conversation

@Dobbymin
Copy link
Copy Markdown
Contributor

📝 요약 (Summary)

메인 페이지에 '대체 매물', '임대인 매물', '임대인 신뢰도' 등 새로운 정보 섹션과 관련 차트 및 컴포넌트들을 추가하여 사용자에게 더 풍부한 매물 및 임대인 신뢰도 정보를 제공합니다.

✅ 주요 변경 사항 (Key Changes)

  • 메인 페이지에 대체 매물, 임대인 매물, 임대인 신뢰도 섹션 추가 및 관련 컴포넌트 구현
  • 위험도 및 신뢰도 비교 차트 컴포넌트 개발 및 개선
  • 매물 데이터, 타입 정의, 색상 체계 및 페이지네이션 기능 구현
  • 임대인 신뢰도 관련 데이터 및 등급별 색상 클래스 추가

💻 상세 구현 내용 (Implementation Details)

  • 메인 페이지 섹션 추가: 메인 페이지의 정보 제공을 강화하기 위해 대체 매물 섹션, 임대인 매물 섹션, 임대인 신뢰도 섹션을 추가했습니다. 이를 통해 사용자에게 다양한 매물 정보와 임대인의 신뢰도 관련 데이터를 시각적으로 제공하여 서비스 활용도를 높였습니다.
  • 컴포넌트 구현 및 재사용성:
    • 새로 추가된 섹션들을 위해 임대인 매물 섹션 컴포넌트, 대체 매물 섹션 컴포넌트, 임대인 신뢰도 섹션 컴포넌트를 독립적으로 구현했습니다.
    • 위험 점수 신뢰도 비교 차트 컴포넌트, 매물 리스트 박스 컴포넌트, 페이지네이션 컴포넌트 등 재사용 가능한 UI 컴포넌트들을 개발하여 메인 페이지의 복잡성을 관리하고 코드의 모듈성을 향상시켰습니다.
    • 신뢰도 관련 컴포넌트들을 추가하여 임대인 신뢰도 섹션 내에서 다양한 신뢰도 정보를 구조화하고 효율적으로 표시할 수 있도록 지원합니다.

@Dobbymin Dobbymin self-assigned this Aug 21, 2025
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @Dobbymin, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the main page user interface by introducing three new sections: 'Alternative Properties', 'Landlord Properties', and 'Landlord Reliability'. These additions aim to provide users with a richer and more detailed view of property listings and landlord trust information. The changes include the development of new, reusable UI components such as a pagination system and property list boxes, alongside specialized components for visualizing landlord reliability data. The update also incorporates new data structures and utility functions for dynamic styling and data presentation, making the main page more informative and interactive.

Highlights

  • Main Page UI Expansion: Three new dedicated sections have been added to the main page: 'Alternative Properties', 'Landlord Properties', and 'Landlord Reliability', significantly expanding the information available to users.
  • Reusable Pagination Component: A reusable Pagination component has been implemented, enhancing navigation for property listings within the new sections.
  • Property Listing and Display: The PropertyListBox component was developed to display property details, featuring dynamic color coding based on property types and integrating pagination.
  • Landlord Reliability Visualization: A suite of components (GradeBox, MultiHouseBox, ReasonBox, SubrogationPaymentBox) has been introduced to visually represent various aspects of landlord reliability, including grades, multi-house ownership, and subrogation history.
  • Chart Component Reusability: The RiskChartBox component was made more generic by adding a configurable title, allowing it to be reused across different risk assessment contexts.
  • Dynamic Styling and Color Utilities: New utility functions and CSS classes were added to dynamically assign colors to property types and to visually categorize landlord reliability metrics.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

메인 페이지 UI 개선을 위한 PR 잘 보았습니다. 대체 매물, 임대인 매물, 임대인 신뢰도 등 새로운 정보 섹션과 관련 컴포넌트들을 추가하여 사용자에게 더 풍부한 정보를 제공하려는 목표가 코드에 잘 반영되었습니다. 전반적으로 컴포넌트 분리와 재사용성이 좋지만, 몇 가지 개선점을 제안합니다. 특히, 페이지네이션 컴포넌트의 확장성, 일부 컴포넌트에서의 타입 안정성 및 일관성, 그리고 Tailwind CSS 클래스 사용법에 대한 검토가 필요해 보입니다. 자세한 내용은 아래 개별 코멘트를 참고해주세요.

Comment on lines +8 to +11
type Props = {
properties: Property[];
title: string;
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

properties prop으로 addColorsToProperties의 결과가 전달되므로, typeColor 속성이 포함되어 있습니다. 타입 안정성을 높이고 typeColor를 컴포넌트 내에서 사용하기 위해 prop 타입을 (Property & { typeColor: string })[]로 명시적으로 지정하는 것이 좋습니다.

Suggested change
type Props = {
properties: Property[];
title: string;
};
type Props = {
properties: (Property & { typeColor: string })[];
title: string;
};

Comment on lines +35 to +42
className='flex h-6 w-16 items-center justify-center rounded-xs text-sm font-medium text-white'
style={{
backgroundColor:
PROPERTY_TYPE_COLORS[property.type as keyof typeof PROPERTY_TYPE_COLORS],
}}
>
{property.type}
</span>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

properties prop에 typeColor가 포함되어 있으므로, 이를 직접 사용하는 것이 좋습니다. 현재 방식은 as 키워드를 사용한 불안전한 타입 캐스팅이며, PROPERTY_TYPE_COLORS에 정의되지 않은 타입에 대한 처리가 누락되어 있습니다. property.typeColor를 사용하면 코드가 더 안전하고 일관성 있어집니다.

                <span
                  className='flex h-6 w-16 items-center justify-center rounded-xs text-sm font-medium text-white'
                  style={{
                    backgroundColor: property.typeColor,
                  }}
                >
                  {property.type}
                </span>

<span className='text-landlord-reliability font-bold text-blue-500'>
{LANDLORD_TRUST_DATA.ownedUnsoldCount}
</span>
<span className='mb-25 text-5xl font-semibold text-black'>채</span>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

mb-25는 Tailwind CSS의 기본 스페이싱 스케일에 포함되지 않는 클래스입니다. 의도한 값이 mb-2.5 (10px) 또는 다른 표준 값이 아닌지 확인이 필요합니다. 만약 커스텀 값이 필요하다면 tailwind.config.js에 정의하거나 인라인 스타일 style={{ marginBottom: '...' }}을 사용하는 것을 고려해주세요. 정의되지 않은 클래스는 레이아웃에 영향을 주지 않을 수 있습니다.

>
{LANDLORD_TRUST_DATA.subrogationCount}
</span>
<span className='mb-25 text-5xl font-semibold text-black'>회</span>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

mb-25는 Tailwind CSS의 기본 스페이싱 스케일에 포함되지 않는 클래스입니다. MultiHouseBox.tsx와 동일한 문제입니다. 의도한 값이 표준 스페이싱 값 중 하나인지 확인하고 수정해주세요.

const riskScore = 70;

return (
<div className='mx-auto my-10 w-full max-w-7xl rounded-lg bg-white px-15 py-10 shadow-[0px_4px_30px_0px_#0000001A]'>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

px-15는 Tailwind CSS의 기본 스페이싱 스케일에 포함되지 않는 클래스입니다. 의도한 값이 px-14 (56px) 또는 px-16 (64px)이 아닌지 확인이 필요합니다. 만약 커스텀 값이 필요하다면 tailwind.config.js에 정의하거나 인라인 스타일을 사용하는 것을 고려해주세요. 정의되지 않은 클래스는 레이아웃에 영향을 주지 않을 수 있습니다.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gemini-code-assist

.px-15 {
    padding-inline: calc(var(--spacing) * 15) /* 3.75rem = 60px */;
}

정의되어있는데?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네, px-15 클래스가 커스텀 CSS로 정의되어 있다면 말씀하신 대로 정상적으로 동작합니다. 제 이전 코멘트는 Tailwind CSS의 기본 유틸리티 클래스 스케일에 해당 클래스가 포함되어 있지 않다는 점을 지적한 것이었습니다. 커스텀 유틸리티 클래스를 사용하시는 경우, 해당 정의가 tailwind.config.js 또는 전역 CSS 파일 등에서 명확하게 관리되고 다른 개발자들이 쉽게 찾을 수 있도록 하는 것이 좋습니다. 확인해주셔서 감사합니다.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아니야 기본으로 정의되어있었어. 이건 너의 오류야.


export const LandlordReliabilitySection = () => {
return (
<div className='mx-auto my-10 w-full max-w-7xl rounded-lg bg-white px-15 py-10 shadow-[0px_4px_30px_0px_#0000001A]'>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

px-15는 Tailwind CSS의 기본 스페이싱 스케일에 포함되지 않는 클래스입니다. 의도한 값이 px-14 (56px) 또는 px-16 (64px)이 아닌지 확인이 필요합니다. 만약 커스텀 값이 필요하다면 tailwind.config.js에 정의하거나 인라인 스타일을 사용하는 것을 고려해주세요. 정의되지 않은 클래스는 레이아웃에 영향을 주지 않을 수 있습니다.

Comment on lines +24 to +37
{Array.from({ length: totalPages }, (_, i) => i + 1).map((page) => (
<Button
variant='ghost'
key={page}
onClick={() => setCurrentPage(page)}
className={`size-8 rounded-full ${
currentPage === page
? 'bg-lighthouse-blue text-white'
: 'text-[#6B7684] hover:bg-[#E6E8EA]'
}`}
>
{page}
</Button>
))}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

페이지 수가 많아질 경우 모든 페이지 버튼을 렌더링하면 UI가 길어지고 사용성이 떨어질 수 있습니다. 예를 들어, 100개의 페이지가 있다면 100개의 버튼이 모두 표시됩니다. 현재 페이지 주변의 일부 페이지만 표시하고 나머지는 '...'으로 처리하는 로직을 추가하여 확장성을 개선하는 것을 고려해보세요.

<div>
<h1 className='text-3xl font-bold'>다주택자</h1>
<div className='flex w-full items-end justify-center'>
<span className='text-landlord-reliability font-bold text-blue-500'>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

색상 값이 text-blue-500으로 하드코딩되어 있습니다. 다주택자 수에 따른 색상을 반환하는 getMultiHouseColorClass 유틸리티 함수가 이미 shared/utils/chart/chart-colors.ts에 구현되어 있으니, 이를 사용하여 일관성을 유지하고 향후 유지보수를 용이하게 하는 것이 좋습니다.

이 변경을 적용하려면 파일 상단에 import { getMultiHouseColorClass } from '@/shared';를 추가해야 합니다.

Suggested change
<span className='text-landlord-reliability font-bold text-blue-500'>
<span className={`text-landlord-reliability font-bold ${getMultiHouseColorClass(LANDLORD_TRUST_DATA.ownedUnsoldCount)}`}>

Comment on lines +4 to +20
const generateDynamicColors = () => {
let colorIndex = 0;

return (type: string): string => {
// 이미 정의된 타입이면 해당 색상 반환
if (type in PROPERTY_TYPE_COLORS) {
return PROPERTY_TYPE_COLORS[type as keyof typeof PROPERTY_TYPE_COLORS];
}

// 정의되지 않은 타입이면 동적 색상 할당
const color = FALLBACK_COLORS[colorIndex % FALLBACK_COLORS.length];
colorIndex++;
return color;
};
};

const getColorForType = generateDynamicColors();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

generateDynamicColors 함수는 클로저를 사용하여 colorIndex 상태를 유지합니다. 이 방식은 함수 호출 순서에 따라 동일한 매물 타입에 다른 색상이 할당될 수 있어 예측 가능성이 떨어질 수 있습니다. 예를 들어, 렌더링 순서가 변경되면 색상이 달라질 수 있습니다. 매물 타입 문자열을 해시하여 FALLBACK_COLORS 배열의 인덱스를 결정하는 stateless한 방식으로 변경하면, 항상 동일한 타입에 동일한 색상을 보장하여 더 안정적인 구현이 될 것입니다.

const getColorForType = (type: string): string => {
  // 이미 정의된 타입이면 해당 색상 반환
  if (type in PROPERTY_TYPE_COLORS) {
    return PROPERTY_TYPE_COLORS[type as keyof typeof PROPERTY_TYPE_COLORS];
  }

  // 정의되지 않은 타입이면 해시를 기반으로 동적 색상 할당
  let hash = 0;
  for (let i = 0; i < type.length; i++) {
    hash = type.charCodeAt(i) + ((hash << 5) - hash);
  }
  const index = Math.abs(hash) % FALLBACK_COLORS.length;
  return FALLBACK_COLORS[index];
};

result = 144 + ((normalized - 80) / 20) * 36;
}

console.log(`보정점수 : ${normalized} 바늘 위치: ${score}점 → ${result}도`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

디버깅 목적으로 사용된 것으로 보이는 console.log가 제거되었습니다. 코드 정리 감사합니다.

@Dobbymin Dobbymin merged commit 5ca66a2 into main Aug 21, 2025
2 checks passed
@Dobbymin Dobbymin deleted the feat#29-mainpage-ui branch August 21, 2025 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UI 구현] 메인페이지 신뢰도 등급 부분 부터 나머지 전부 구현

1 participant