Skip to content

Commit

Permalink
[ fix ] 목표 없을 때 피드백 텍스트 노출
Browse files Browse the repository at this point in the history
  • Loading branch information
NeatKYU committed Sep 9, 2023
1 parent 40b980b commit 5adae12
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/components/banner/MainBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ReactComponent as Eyes } from '@/assets/img/icn_eyes.svg';
import Carousel from '@/components/carousel/Carousel';
import { useState, MouseEventHandler, useEffect } from 'react';
import { useNavigate } from 'react-router-dom';

export type NotToDoBannerItemProps = {
id: number;
Expand All @@ -17,16 +18,25 @@ type BannerItemProps = {
};

export const BannerItem = ({ isOddIndex, info, clickHandler }: BannerItemProps) => {
const isGoal = info.description && info.description !== '';
const navigation = useNavigate();

const handleMoveEditPage = () => {
return !isGoal ? navigation(`/nottodo/edit/${info.id}`) : null;
};
return (
<div
className={`flex flex-col justify-center items-center w-full h-full ${
isOddIndex ? 'bg-gray-900' : 'bg-primary'
}`}
onClick={clickHandler}
>
<div className={`flex flex-col items-center mt-20 ${isOddIndex ? 'text-gray-0' : 'text-gray-900'}`}>
<div
className={`flex flex-col items-center mt-20 ${isOddIndex ? 'text-gray-0' : 'text-gray-900'}`}
onClick={handleMoveEditPage}
>
<p className="text-2xl font-bold">{info.title}</p>
<p className="text-base">{info.description}</p>
<p className="text-base">{isGoal ? info.description : '최종 목표를 입력해주세요'}</p>
</div>
<div
className={`rounded border-[1px] border-gray-900 relative px-3 py-1 mt-10 mb-[60px] ${
Expand Down

0 comments on commit 5adae12

Please sign in to comment.