Skip to content
Closed
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import ServiceGuidePage from './pages/ServiceGuidePage';
const MainLayout = () => {
return (
<>
<div className=" min-h-screen flex flex-col">
<main style={{ minHeight: 'calc(100vh - 50px - 80px)' }}>
<div className="h-[100dvh] flex flex-col ">
<main className="h-auto scroll-target">
<Outlet />
<Footer />
</main>
<Footer />
</div>
</>
);
Expand Down
4 changes: 3 additions & 1 deletion client/src/components/ComparePage/BenefitComparisonRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ const BenefitComparisonRow: React.FC<BenefitComparisonRowProps> = ({
</TextWrapper>
)}
</div>
<div className="pt-[13%] w-25 text-sm flex justify-center">{title}</div>
<div className="flex-[1] pt-[13%] w-25 text-sm flex justify-center">
{title}
</div>
<div className="flex-[2] relative flex flex-col items-center gap-1 justify-center">
{rightIcon && rightContent && (
<ImageWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ const ComparisonActionButtons: React.FC<ComparisonActionButtonsProps> = ({
}) => {
return (
<div
className={`flex flex-col justify-center items-center text-center gap-6 ${className}`}
style={{ width: 'calc(100% - 40px)' }}
className={`my-3 flex flex-col justify-center items-center text-center gap-6 ${className}`}
>
<div className="flex w-full">
<div className="flex-[2] relative flex flex-col items-center justify-center rounded-[10px]">
Expand Down
27 changes: 2 additions & 25 deletions client/src/components/ComparePage/ComparisonResult.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useState } from 'react';
import { useState } from 'react';
import togetherIcon from '@/assets/image/card_family.png';
import premiumAddonsIcon from '@/assets/icon/special.png';
import mediaAddonsIcon from '@/assets/icon/media.png';
Expand All @@ -22,33 +22,13 @@ const ComparisonResult: React.FC<ComparisonResultProps> = ({
}) => {
const [isModalOpen, setIsModalOpen] = useState(false);
const [pendingLink, setPendingLink] = useState<string | null>(null);
const [showButtons, setShowButtons] = useState(false);

const handleDetailClick = (detailUrl?: string) => {
if (detailUrl) {
setPendingLink(detailUrl); // 링크만 저장
setIsModalOpen(true); // 모달 먼저 띄우기
}
};
useEffect(() => {
const scrollContainer = document.querySelector('.scroll-target');
if (!scrollContainer) return;

const handleScroll = () => {
const scrollTop = scrollContainer.scrollTop;
const containerHeight = scrollContainer.clientHeight;
const scrollHeight = scrollContainer.scrollHeight;

if (scrollTop + containerHeight >= scrollHeight - 100) {
setShowButtons(true);
} else {
setShowButtons(false);
}
};

scrollContainer.addEventListener('scroll', handleScroll);
return () => scrollContainer.removeEventListener('scroll', handleScroll);
}, []);

// 데이터 값 계산
const leftDataValue = selectedLeft
Expand Down Expand Up @@ -116,7 +96,7 @@ const ComparisonResult: React.FC<ComparisonResultProps> = ({

<div className="w-full bg-gray200 h-[1px] my-5" />

<div className="flex flex-col justify-center items-center text-center w-full gap-6 mb-[106px]">
<div className="flex flex-col justify-center items-center text-center w-full gap-6">
<BenefitComparisonRow
leftContent={
selectedLeft?.bundleBenefit ? (
Expand Down Expand Up @@ -184,9 +164,6 @@ const ComparisonResult: React.FC<ComparisonResultProps> = ({
rightButtonText={selectedRight ? '자세히 보기' : ''}
onLeftClick={() => handleDetailClick(selectedLeft?.detailUrl)}
onRightClick={() => handleDetailClick(selectedRight?.detailUrl)}
className={`fixed bottom-[50px] max-w-[560px] transition-all duration-500
${showButtons ? 'opacity-100 translate-y-0 pointer-events-auto' : 'opacity-0 translate-y-5 pointer-events-none'}
`}
/>

<Modal
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/common/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Footer = () => {
return (
<footer className="absolute bottom-0 w-full max-w-[600px] mx-auto px-5 py-1 flex justify-center items-center text-xs text-[rgba(87,50,161,0.8)] text-center">
<footer className="w-full max-w-[600px] mx-auto px-5 py-1 flex justify-center items-center text-xs text-[rgba(87,50,161,0.8)] text-center">
<p>@meplus.com</p>
</footer>
);
Expand Down
4 changes: 2 additions & 2 deletions client/src/pages/ComparePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ const ComparePage: React.FC = () => {
}, []);

return (
<div className="h-[100dvh] flex flex-col scroll-auto">
<div className="flex flex-col scroll-auto">
<Header title="요금제 비교하기" onBackClick={() => openModal()} />

<div className="flex-1 overflow-y-auto px-5 hide-scrollbar scroll-target">
<div className="flex-1 overflow-y-auto px-5 hide-scrollbar">
<ComparePageTitle>
비교하고 싶은
<br />
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const MainPage: React.FC = () => {
const shouldCenter = windowHeight >= 790;

return (
<div className="w-full h-[100dvh] flex justify-center items-stretch overflow-hidden">
<div className="w-full flex justify-center items-stretch overflow-hidden">
<div className="w-full max-w-[600px] flex flex-col overflow-hidden">
<div
className={`flex-1 overflow-y-auto px-5 pt-8 pb-8 hide-scrollbar ${
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/TestPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ const TestPage = () => {
);

return (
<div className="h-[100dvh] flex flex-col items-center overflow-hidden">
<div className="flex flex-col items-center overflow-hidden">
<div className="w-full max-w-[600px] flex-1 overflow-y-auto mt-[35px] px-5 hide-scrollbar">
<Header
title="나에게 잘 어울리는 요금제는?"
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/TestResultPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const TestResultPage = () => {
}

return (
<div className="h-[100dvh] flex flex-col items-center overflow-hidden relative bg-gradient-to-b from-[#dfe4fd] to-white">
<div className="h-full flex flex-col items-center overflow-hidden relative bg-gradient-to-b from-[#dfe4fd] to-white">
<div className="w-full max-w-[600px] flex-1 overflow-y-auto px-5 z-10 text-center hide-scrollbar">
{isModalOpen && (
<Modal
Expand Down
Loading