Skip to content

Commit 37f0db6

Browse files
committed
Feat: Feed 컴포넌트에 relativeTime 플로그인 추가
1 parent ed4c7fc commit 37f0db6

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/pages/Chats/ChatRoomItem/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import type { ChatRoomData } from '@apis/chatting/dto';
1717

1818
import { UserImage, ChatRoomItemLayout, LeftBox, RightBox, LatestMessage } from './styles';
1919

20-
import 'dayjs/locale/ko';
21-
2220
const ChatRoomItem: React.FC<ChatRoomData> = ({ id, otherUser, latestMessage }) => {
2321
const [timeAgo, setTimeAgo] = useState<string | null>(null);
2422
const [, setOtherUser] = useRecoilState(OtherUserAtom);

src/pages/Home/OOTD/Feed/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { useState } from 'react';
22
import { useNavigate } from 'react-router-dom';
33

4-
import dayjs from 'dayjs';
4+
import dayjs, { extend } from 'dayjs';
5+
import relativeTime from 'dayjs/plugin/relativeTime';
56
import { Pagination } from 'swiper/modules';
67
import { Swiper, SwiperSlide } from 'swiper/react';
78
import 'swiper/css';
@@ -58,6 +59,7 @@ const Feed: React.FC<FeedProps> = ({ feed }) => {
5859
const [isStatusModalOpen, setIsStatusModalOpen] = useState(false);
5960
const [modalContent, setModalContent] = useState('');
6061

62+
extend(relativeTime);
6163
const nav = useNavigate();
6264
const currentUserId = getCurrentUserId();
6365
const timeAgo = dayjs(feed.createdAt).locale('ko').fromNow();

0 commit comments

Comments
 (0)