Skip to content

Commit ea273dd

Browse files
authored
Merge pull request #176 from DevKor-github/feat/#175/chatlist-item
feat: ์ฑ„ํŒ… ๋ฆฌ์ŠคํŠธ์—์„œ ์•„์ดํ…œ ์ธ๋„ค์ผ ์ถ”๊ฐ€
2 parents 53c7015 + 24d37ca commit ea273dd

File tree

4 files changed

+41
-2
lines changed

4 files changed

+41
-2
lines changed

โ€Žsrc/features/chatList/components/ChatList/index.tsxโ€Ž

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ import useDrawer from '@/common/hooks/useDrawer';
1111
import ChatDrawer from '../ChatDrawer';
1212
import { useState } from 'react';
1313
import CustomAlert from '@/common/components/CustomAlert';
14-
import { usePatchExit } from '../../api/usePatchExit';
14+
import { usePatchExit, type ExitResponse } from '../../api/usePatchExit';
15+
import type { AxiosError } from 'axios';
16+
import getImageUrl from '@/common/utils/getImageUrl';
1517
import { getInProgress } from '../../api/useGetInProgess';
1618

1719
export interface Props {
@@ -25,6 +27,8 @@ const ChatList = ({ data }: Props) => {
2527
const [showExitAlert, setShowExitAlert] = useState(false);
2628
const [showErrorAlert, setShowErrorAlert] = useState(false);
2729

30+
const thumbnail = data.itemThumbnailUrl ? getImageUrl(data.itemThumbnailUrl) : 'base-url';
31+
2832
const onUnshowAlert = () => {
2933
if (showExitAlert) setShowExitAlert(false);
3034
if (showErrorAlert) setShowErrorAlert(false);
@@ -65,7 +69,10 @@ const ChatList = ({ data }: Props) => {
6569
return (
6670
<>
6771
<Link className={s.List} to={`/chatroom/${data.chatRoomId}`} {...bind()}>
68-
<UserProfileImage nickname={data.opponentNickname} src={data.opponentProfileImageUrl} />
72+
<div className={s.Img}>
73+
<img className={s.Thumbnail} src={thumbnail} />
74+
<UserProfileImage nickname={data.opponentNickname} src={data.opponentProfileImageUrl} />
75+
</div>
6976
<div className={s.Contents}>
7077
<div className={s.TimeInfo}>
7178
<div className={s.UserInfo}>

โ€Žsrc/features/chatList/components/ChatList/style.css.tsโ€Ž

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,29 @@ export const List = css({
66
gap: '0.87rem',
77
});
88

9+
export const Img = css({
10+
w: '3.5rem',
11+
h: '3.5rem',
12+
position: 'relative',
13+
display: 'inline-block',
14+
});
15+
16+
export const Thumbnail = css({
17+
display: 'flex',
18+
position: 'absolute',
19+
right: 0,
20+
bottom: 0,
21+
w: '2rem',
22+
h: '2rem',
23+
bg: 'systemGray',
24+
flexShrink: 0,
25+
aspectRatio: '1/1',
26+
objectFit: 'cover',
27+
borderRadius: '0.375rem',
28+
border: '1px solid var(--100, #FFF)',
29+
boxShadow: '0px 0px 4px 0px rgba(0, 0, 0, 0.10)',
30+
});
31+
932
export const Contents = css({
1033
display: 'flex',
1134
flex: 1,

โ€Žsrc/features/chatList/types.tsโ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export interface ChatListInterface {
1010
mostRecentChatIsPick: boolean | null;
1111
lastChatAt: string | null;
1212
unreadChatCount: number;
13+
itemThumbnailUrl: string;
1314
}
1415

1516
export interface SubChatListInterface {

โ€Žsrc/features/chatRoom/components/ChatRoomLayout/ChatRoomHeader/style.css.tsโ€Ž

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ export const UserInfo = css({
1414
gap: '0.875rem',
1515
justifyContent: 'center',
1616
alignItems: 'center',
17+
18+
color: '100',
19+
fontFamily: 'Pretendard',
20+
fontSize: ' 1rem',
21+
fontStyle: 'normal',
22+
fontWeight: 500,
23+
lineHeight: 'normal',
24+
letterSpacing: '-0.04rem',
1725
});
1826

1927
export const Verifiy = css({

0 commit comments

Comments
ย (0)