Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,27 @@ import { StatusType } from '@shared/types/type.ts';

import * as styles from './recommended-info-section.css.ts';

interface recommendedInfoSectionProps {
interface StaticContentProps {
userName?: string;
productName?: string;
company?: string;
keywordChips?: string[];
}

/** 보험 추천받은 유저가 볼 화면 */
export const RecommendedInfoSection = ({
const StaticContent = ({
Comment on lines +18 to +25
Copy link
Member

@jogpfls jogpfls Dec 29, 2025

Choose a reason for hiding this comment

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

따로 이 컴포넌트들을 파일로 분리 안하신 이유가 있나요?!

Copy link
Member Author

Choose a reason for hiding this comment

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

파일 분리를 고민하다가, 재사용 목적이 아니고 분산시킬 필요성이 우리 눈에 깔끔한 거라면 불필요하다고 생각했어요.
StaticContent, BottomButton 이 이 파일에서만 쓰이는 로컬 UI 이기 때문에 같은 파일에 두어서 지역성을 유지하는 게 낫다고 생각했는데, 요 부분은 코드리뷰에서 논의해보고 싶었어요. 혜린님은 분리하는 게 좋다고 생각하시나요!

userName,
}: recommendedInfoSectionProps) => {
const navigate = useNavigate();
const handleNavigateReport = () => {
navigate(routePath.REPORT);
};

const { data: reportSummary } = useSuspenseQuery(
HOME_QUERY_OPTIONS.REPORT_SUMMARY(),
);
const targetToIconMap = new Map(
homeCardConfig.map(({ target, icon }) => [target, icon]),
);

if (!reportSummary) {
return;
}

productName,
company,
keywordChips,
}: StaticContentProps) => {
return (
<section className={styles.infoSection}>
<>
<img
src={'./3Dicon_background.webp'}
width={223}
height={185}
className={styles.backgroundLogo}
alt=""
/>
<div className={styles.titleSection}>
<InsuranceSubtitle
Expand All @@ -58,11 +48,11 @@ export const RecommendedInfoSection = ({
<InsuranceTitle
fontColor={'white'}
fontStyle={'eb_28'}
name={reportSummary.productName}
company={reportSummary.company}
name={productName}
company={company}
/>
<div className={styles.chipList}>
{reportSummary.keywordChips?.map((chip, index) => (
{keywordChips?.map((chip, index) => (
<Chip
key={index}
variant="round"
Expand All @@ -74,7 +64,56 @@ export const RecommendedInfoSection = ({
))}
</div>
</div>
</>
);
};

interface BottomButtonProps {
onClick: () => void;
}

const BottomButton = ({ onClick }: BottomButtonProps) => {
return (
<div className={styles.bottomButton}>
<TextButton color={'white'} size="sm" onClick={onClick}>
<p>구체적인 내용 확인하기</p>
<Icon name={'caret_right_md'} color="white" />
</TextButton>
</div>
);
};

interface recommendedInfoSectionProps {
userName?: string;
}

/** 보험 추천받은 유저가 볼 화면 */
export const RecommendedInfoSection = ({
userName,
}: recommendedInfoSectionProps) => {
const navigate = useNavigate();
const handleNavigateReport = () => navigate(routePath.REPORT);

const { data: reportSummary } = useSuspenseQuery(
HOME_QUERY_OPTIONS.REPORT_SUMMARY(),
);

const targetToIconMap = new Map(
homeCardConfig.map(({ target, icon }) => [target, icon]),
);

if (!reportSummary) {
return;
}

return (
<section className={styles.infoSection}>
<StaticContent
userName={userName}
productName={reportSummary.productName}
company={reportSummary.company}
keywordChips={reportSummary.keywordChips}
/>
<Carousel slidesPerView={4.5} autoPlay className={styles.homeCardList}>
{reportSummary.statuses?.map((card, index) => (
<Carousel.Item key={index}>
Expand All @@ -92,13 +131,7 @@ export const RecommendedInfoSection = ({
</Carousel.Item>
))}
</Carousel>

<div className={styles.bottomButton}>
<TextButton color={'white'} size="sm" onClick={handleNavigateReport}>
<p>구체적인 내용 확인하기</p>
<Icon name={'caret_right_md'} color="white" />
</TextButton>
</div>
<BottomButton onClick={handleNavigateReport} />
</section>
);
};
Loading