Skip to content

Commit

Permalink
Merge pull request #240 from TEAM-MONGDOL/MF-366-WkSimulationRefactor
Browse files Browse the repository at this point in the history
[refactor] - 워케이션 시뮬레이션 리팩토링
  • Loading branch information
eunji0714 authored Aug 17, 2024
2 parents d31c8a1 + 078529e commit eada106
Show file tree
Hide file tree
Showing 3 changed files with 197 additions and 109 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ const InfoSectionContainer = ({
title,
row,
}: InfoSectionContainerProps) => {
const widthValue = row ? 330 : '100%'; // width, height 재설정해야함
return (
<div className="w-full rounded-regular border border-stroke-100 bg-cus-100 px-4 py-5">
{title && <p className="mb-7 text-1 font-bold">{title}</p>}
<div className={`flex ${row ? 'items-center gap-10' : 'flex-col gap-7'}`}>
{image && (
<Image
className="max-h-[210px] min-h-[210px] min-w-[330px] max-w-[330px]"
width={typeof widthValue === 'number' ? widthValue : undefined}
width={100}
height={100}
src={image}
alt="Image"
Expand Down
7 changes: 3 additions & 4 deletions src/app/_components/user/workation/WkResultInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import InfoSectionModule from '@/_components/common/modules/InfoSectionModule';

const WkResultInfo = ({ id }: { id: number }) => {
const { data, isLoading, isError } = useGetWkPenaltyQuery({ wktId: id });
console.log(data);
const gcd = (a: number, b: number): number => {
if (b === 0) return a;
return gcd(b, a % b);
Expand All @@ -29,15 +28,15 @@ const WkResultInfo = ({ id }: { id: number }) => {
return (
<div>
<WkSlider id={id} />
<div className="flex flex-col">
<div className="mt-10 flex flex-col">
<UserSubtitleAtom subtitle="추첨 결과" />
<div className="flex w-full gap-3.5 overflow-x-auto scrollbar-hide">
{data?.wktWinningUserInfos.map(
(winner) =>
winner.applyStatusType === 'CANCEL' || (
<div
key={winner.accountId}
className={`flex h-16 w-[200px] min-w-[200px] items-center rounded-full ${winner.applyStatusType === 'CONFIRM' || 'VISITED' ? 'bg-primary' : 'bg-primary/50'}`}
className={`flex h-16 w-[200px] min-w-[200px] items-center rounded-full ${winner.applyStatusType === 'CONFIRM' || winner.applyStatusType === 'VISITED' ? 'bg-primary' : 'bg-primary/50'}`}
>
<p className="ml-2.5 mr-4 h-12 w-12 rounded-full bg-white pt-3 text-center">
최초
Expand All @@ -54,7 +53,7 @@ const WkResultInfo = ({ id }: { id: number }) => {
waiter.waitingNum < 0 || (
<div
key={waiter.accountId}
className={`flex h-16 w-[200px] min-w-[200px] items-center rounded-full ${waiter.applyStatusType === ('CONFIRM' || 'VISITED') ? 'bg-primary' : 'bg-primary/50'}`}
className={`flex h-16 w-[200px] min-w-[200px] items-center rounded-full ${waiter.applyStatusType === 'CONFIRM' || waiter.applyStatusType === 'VISITED' ? 'bg-primary' : 'bg-primary/50'}`}
>
<p className="ml-2.5 mr-3.5 h-12 w-12 rounded-full bg-white pt-2.5 text-center">
{index + 1}
Expand Down
Loading

0 comments on commit eada106

Please sign in to comment.