Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ const nextConfig: NextConfig = {
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'lh3.googleusercontent.com',
},
],
//imagesSizes, deviceSizes는 기본 설정
imageSizes: [96, 128, 256, 384],
Expand Down
4 changes: 2 additions & 2 deletions src/components/pages/chat/chat-list/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use client';
import Image from 'next/image';
import { useRouter } from 'next/navigation';

import { useMemo } from 'react';

import { DEFAULT_PROFILE_IMAGE } from 'constants/default-images';

import { ImageWithFallback } from '@/components/ui';
import { useChatListSocket, useGetChatList } from '@/hooks/use-chat';
import { cn } from '@/lib/utils';

Expand Down Expand Up @@ -52,7 +52,7 @@ export const ChatList = ({ userId, accessToken }: IProps) => {
>
{/* 프로필 이미지 - 이미지 수정 필요💥💥*/}
<div className='relative size-12 overflow-hidden rounded-full'>
<Image
<ImageWithFallback
className='object-cover'
alt='프로필 이미지'
fill
Expand Down
10 changes: 3 additions & 7 deletions src/components/pages/chat/chat-other-chat/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import Image from 'next/image';

import { DEFAULT_PROFILE_IMAGE } from 'constants/default-images';

import { ImageWithFallback } from '@/components/ui';
import { formatKoreanTime } from '@/lib/formatDateTime';
import { ChatMessage } from '@/types/service/chat';

Expand All @@ -14,15 +11,14 @@ interface IProps {
export const OtherChat = ({ item }: IProps) => {
const { senderProfileImage, senderName, content, timestamp, createdAt } = item;
const time = timestamp ?? createdAt;

return (
<div className='flex'>
<Image
<ImageWithFallback
width={40}
className='mr-3 size-10 rounded-full object-cover'
alt='프로필 이미지'
height={40}
src={senderProfileImage || DEFAULT_PROFILE_IMAGE}
src={senderProfileImage || ''}
/>

<div className='mr-1.5 max-w-60'>
Expand Down
8 changes: 7 additions & 1 deletion src/components/pages/chat/chat-user-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ export const UserList = ({ onClose, roomId, roomType, userId }: UserListProps) =
const isCurrentUserOwner = data?.participants.some(
(participant) => participant.userId === userId && participant.isOwner,
);
const sortedParticipants = data?.participants
? [...data.participants].sort((a, b) => {
if (a.isOwner === b.isOwner) return 0;
return a.isOwner ? -1 : 1;
})
: [];

return (
<div className='bg-mono-white flex h-[calc(100vh-112px)] flex-col'>
Expand Down Expand Up @@ -55,7 +61,7 @@ export const UserList = ({ onClose, roomId, roomType, userId }: UserListProps) =

{/* 유저 리스트 */}
<div className='scrollbar-thin flex-1 overflow-y-auto'>
{data?.participants.map((user, index) => (
{sortedParticipants.map((user, index) => (
<div key={user.userId}>
<div className='bg-mono-white flex h-22 items-center gap-4 p-5'>
<div className='h-12 w-12 overflow-hidden rounded-full'>
Expand Down