Skip to content

Commit

Permalink
hotfix: 소식 이벤트 데이터 Date 전처리 서버 패칭에서만 한번 처리하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
youngminss committed Feb 21, 2025
1 parent 94ce55e commit b17acbc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
import { Icon } from '@/assets/icons';
import Image from 'next/image';
import Link from 'next/link';
import { convertStartAndEndDate } from '../../api/fetchBlockchainInformation';
import { TBlockchainInformationData, TBlockchainInformationType } from '../../type';
import { TBlockchainInformationData } from '../../type';
import BlockChainLabel from '../BlockchainLabel/BlockchainLabel';

const BlockchainEvent = ({
blockchainEventType,
blockchainEvent,
}: {
blockchainEventType?: TBlockchainInformationType;
blockchainEvent: TBlockchainInformationData;
}) => {
const BlockchainEvent = ({ blockchainEvent }: { blockchainEvent: TBlockchainInformationData }) => {
const { url, imgUrl, title, startDate, endDate, network, host, prize } = blockchainEvent;

const [convertedStartDate, convertedEndDate] = convertStartAndEndDate({
startDate,
endDate,
blockchainInformationType: blockchainEventType,
});

return (
<Link href={url} target="_blank">
<div className="group flex gap-x-[2rem]">
Expand All @@ -40,7 +27,7 @@ const BlockchainEvent = ({
<div>
<BlockChainLabel className="mb-[0.8rem]" blockchainNetwork={network} />
<p className="text-nowrap pb-[0.2rem] text-body-2-medium text-gray-700">
{convertedStartDate} ~ {convertedEndDate}
{startDate} ~ {endDate}
</p>
<h3 className="line-clamp-1 break-all text-title-3-semibold text-gray-900 group-hover:underline">
{title}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const BlockchainEventList = ({
key={`${blockchainEvent.id}-${blockchainEvent.sourceIndex}`}
onClick={() => handleInformationClick(blockchainEvent, blockchainEventType)}
>
<BlockchainEvent blockchainEventType={blockchainEventType} blockchainEvent={blockchainEvent} />
<BlockchainEvent blockchainEvent={blockchainEvent} />
</li>
);
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ const BlockchainEventSectionClient = ({

const handleEventTabClick = (selectedEventTab: TEventTab) => {
if (swiperRef && swiperRef?.current) {
setCurrentEventTabValue(selectedEventTab);
setCurrentPage(1);
swiperRef.current.swiper.slideTo(0, 0);
}

if (scrollRef && scrollRef.current) {
scrollRef.current.scrollTo(0, 0);
}

setCurrentEventTabValue(selectedEventTab);
};

const handlePrevClick = () => {
Expand Down Expand Up @@ -97,6 +98,7 @@ const BlockchainEventSectionClient = ({

<div className="md:px-[4rem] mobile:px-0">
<BlockchainEventList
key={currentEventTabValue}
blockchainEventType={currentEventTabValue}
blockchainEventList={currentEventTabValue === 'hackathon' ? hackathonList : meetupList}
swiperRef={swiperRef}
Expand Down

0 comments on commit b17acbc

Please sign in to comment.