Skip to content

Commit 297e834

Browse files
committed
Fix: chats 페이지 import문 수정
1 parent 82e64e7 commit 297e834

13 files changed

Lines changed: 94 additions & 46 deletions

File tree

src/pages/Chats/ChatRoomItem/index.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1-
import { StyledText } from '@components/Text/StyledText';
2-
import { UserImage, ChatRoomItemLayout, LeftBox, RightBox, LatestMessage } from './styles';
1+
import { useEffect, useState } from 'react';
32
import { useNavigate } from 'react-router-dom';
4-
import { useRecoilState } from 'recoil';
5-
import { OtherUserAtom } from '@recoil/util/OtherUser';
3+
64
import dayjs from 'dayjs';
75
import relativeTime from 'dayjs/plugin/relativeTime';
8-
import 'dayjs/locale/ko';
9-
import { useEffect, useState } from 'react';
10-
import type { ChatRoomData } from '@apis/chatting/dto';
11-
import defaultProfile from '@assets/default/defaultProfile.svg';
6+
import { useRecoilState } from 'recoil';
7+
128
import theme from '@styles/theme';
9+
10+
import { OtherUserAtom } from '@recoil/util/OtherUser';
11+
12+
import defaultProfile from '@assets/default/defaultProfile.svg';
13+
14+
import { StyledText } from '@components/Text/StyledText';
15+
16+
import type { ChatRoomData } from '@apis/chatting/dto';
17+
18+
import { UserImage, ChatRoomItemLayout, LeftBox, RightBox, LatestMessage } from './styles';
19+
20+
import 'dayjs/locale/ko';
1321
dayjs.extend(relativeTime);
1422

1523
const ChatRoomItem: React.FC<ChatRoomData> = ({ id, otherUser, latestMessage }) => {

src/pages/Chats/ChatRoomItem/styles.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { styled } from 'styled-components';
2+
23
import { StyledText } from '@components/Text/StyledText';
34

45
export const ChatRoomItemLayout = styled.li`

src/pages/Chats/Matching/Cards/Card/dto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { MatchingDto } from '@apis/matching/dto';
1+
import type { MatchingDto } from '@apis/matching/dto';
22

33
export interface CardProps {
44
removeRejectedMatching: () => void;

src/pages/Chats/Matching/Cards/Card/index.tsx

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
1-
import React, { useState } from 'react';
2-
import { StyledText } from '@components/Text/StyledText';
3-
import { Swiper, SwiperSlide } from 'swiper/react';
1+
import { useState } from 'react';
2+
import { useNavigate } from 'react-router-dom';
3+
4+
import { useRecoilState } from 'recoil';
45
import { Pagination } from 'swiper/modules';
6+
import { Swiper, SwiperSlide } from 'swiper/react';
57
import 'swiper/css';
68
import 'swiper/css/pagination';
9+
710
import theme from '@styles/theme';
11+
12+
import { modifyMatchingStatusApi } from '@apis/matching';
13+
import { handleError } from '@apis/util/handleError';
14+
import { OtherUserAtom } from '@recoil/util/OtherUser';
15+
16+
import acceptButton from '@assets/default/accept.svg';
17+
import defaultProfile from '@assets/default/defaultProfile.svg';
18+
import rejectButton from '@assets/default/reject.svg';
19+
20+
import Modal from '@components/Modal';
21+
import { StyledText } from '@components/Text/StyledText';
22+
23+
import type { ModalProps } from '@components/Modal/dto';
24+
25+
import type { CardProps } from './dto';
26+
827
import {
928
ArrowButton,
1029
Btn,
@@ -17,17 +36,6 @@ import {
1736
Reaction,
1837
SeeMore,
1938
} from './styles';
20-
import rejectButton from '@assets/default/reject.svg';
21-
import acceptButton from '@assets/default/accept.svg';
22-
import defaultProfile from '@assets/default/defaultProfile.svg';
23-
import { useNavigate } from 'react-router-dom';
24-
import { modifyMatchingStatusApi } from '@apis/matching';
25-
import { handleError } from '@apis/util/handleError';
26-
import type { ModalProps } from '@components/Modal/dto';
27-
import Modal from '@components/Modal';
28-
import { useRecoilState } from 'recoil';
29-
import { OtherUserAtom } from '@recoil/util/OtherUser';
30-
import type { CardProps } from './dto';
3139

3240
const Card: React.FC<CardProps> = ({ removeRejectedMatching, matching }) => {
3341
const [isStatusModalOpen, setIsStatusModalOpen] = useState(false);

src/pages/Chats/Matching/Cards/Card/styles.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { styled } from 'styled-components';
2+
23
import ArrowIcon from '@assets/arrow/min-right.svg';
34

45
export const CardLayout = styled.div`

src/pages/Chats/Matching/Cards/index.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
import React, { useEffect, useRef, useState } from 'react';
2-
import { Swiper, SwiperRef, SwiperSlide } from 'swiper/react';
1+
import { useEffect, useRef, useState } from 'react';
2+
33
import { Pagination } from 'swiper/modules';
4+
import { Swiper, SwiperRef, SwiperSlide } from 'swiper/react';
5+
46
import 'swiper/css';
57
import 'swiper/css/pagination';
6-
import { CardsContainer } from './styles';
7-
import Card from './Card/index';
88
import { getMatchingListApi } from '@apis/matching';
9+
910
import type { MatchingDto } from '@apis/matching/dto';
11+
1012
import type { CardsProps } from './dto';
1113

14+
import Card from './Card/index';
15+
16+
import { CardsContainer } from './styles';
17+
1218
const Cards: React.FC<CardsProps> = ({ decreaseMatchingCount }) => {
1319
const [matchings, setMatchings] = useState<MatchingDto[]>([]);
1420
const swiperRef = useRef<SwiperRef | null>(null);

src/pages/Chats/Matching/index.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
import React from 'react';
2-
import Cards from './Cards/index';
1+
import { memo } from 'react';
2+
33
import theme from '@styles/theme';
4-
import { ReqeustInfo } from './styles';
4+
55
import { StyledText } from '@components/Text/StyledText';
6+
67
import type { MatchingProps } from './dto';
78

9+
import Cards from './Cards/index';
10+
11+
import { ReqeustInfo } from './styles';
12+
813
const Matching: React.FC<MatchingProps> = ({ matchingCount, decreaseMatchingCount }) => {
914
return (
1015
<>
@@ -19,4 +24,4 @@ const Matching: React.FC<MatchingProps> = ({ matchingCount, decreaseMatchingCoun
1924
);
2025
};
2126

22-
export default React.memo(Matching);
27+
export default memo(Matching);

src/pages/Chats/Matching/styles.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { styled } from 'styled-components';
2+
23
import { StyledText } from '@components/Text/StyledText';
34

45
export const ReqeustInfo = styled(StyledText)`

src/pages/Chats/RecentChat/index.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1-
import { ChatRoomList, NoChatRoomWrapper, RecentChatInfo } from './styles';
2-
import React, { useEffect, useState } from 'react';
1+
import { useEffect, useState } from 'react';
2+
33
import SwiperCore from 'swiper';
4+
5+
import theme from '@styles/theme';
6+
7+
import { useSocket } from '@context/SocketProvider';
8+
import { getCurrentUserId } from '@utils/getCurrentUserId';
9+
410
import Loading from '@components/Loading';
5-
import ChatRoomItem from '../ChatRoomItem/index';
611
import { StyledText } from '@components/Text/StyledText';
7-
import { useSocket } from '@context/SocketProvider';
12+
813
import type { ChatRoomData } from '@apis/chatting/dto';
9-
import { getCurrentUserId } from '@utils/getCurrentUserId';
10-
import theme from '@styles/theme';
14+
15+
import ChatRoomItem from '../ChatRoomItem/index';
16+
17+
import { ChatRoomList, NoChatRoomWrapper, RecentChatInfo } from './styles';
1118

1219
interface RecentChatProps {
1320
matchingCount: number;

src/pages/Chats/RecentChat/styles.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { styled } from 'styled-components';
2+
23
import { StyledText } from '@components/Text/StyledText';
34

45
export const RecentChatInfo = styled(StyledText)`

0 commit comments

Comments
 (0)