File tree Expand file tree Collapse file tree 4 files changed +10
-17
lines changed Expand file tree Collapse file tree 4 files changed +10
-17
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import MobileToggle from "@/components/mobile-toggle";
4
4
import SocketIndicator from "@/components/socket-indicator" ;
5
5
import { MemberWithProfile } from "@/types/server" ;
6
6
import { Profile } from "@prisma/client" ;
7
- import UserAvatarWraper from "../user-avatar-wrapper" ;
7
+ import UserAvatarWrapper from "../user-avatar-wrapper" ;
8
8
import { ChatVideoButton } from "./chat-video-button" ;
9
9
10
10
interface ChatHeaderProps {
@@ -36,10 +36,7 @@ const ChatHeader = ({
36
36
< Hash className = "w-5 h-5 text-zinc-500 dark:text-zinc-400 mr-2" />
37
37
) }
38
38
{ type === "conversation" && (
39
- < UserAvatarWraper
40
- imageUrl = { imageUrl || "" }
41
- profile = { callee ?. profile || ( { } as Profile ) }
42
- />
39
+ < UserAvatarWrapper profile = { callee ?. profile || ( { } as Profile ) } />
43
40
) }
44
41
< p className = "font-semibold text-md text-black dark:text-white ml-2" >
45
42
{ name }
Original file line number Diff line number Diff line change @@ -14,11 +14,11 @@ import { ActionTooltip } from "@/components/action-tooltip";
14
14
import { Button } from "@/components/ui/button" ;
15
15
import { Form , FormControl , FormField } from "@/components/ui/form" ;
16
16
import { Input } from "@/components/ui/input" ;
17
- import UserAvatar from "@/components/user-avatar" ;
18
17
import { useModal } from "@/hooks/use-modal-store" ;
19
18
import { cn } from "@/utils/cn" ;
20
19
import axios from "axios" ;
21
20
import { useParams , useRouter } from "next/navigation" ;
21
+ import UserAvatarWrapper from "../user-avatar-wrapper" ;
22
22
23
23
interface ChatItemProps {
24
24
id : string ;
@@ -134,7 +134,7 @@ const ChatItem = ({
134
134
onClick = { onMemberClick }
135
135
className = "cursor-pointer hover:drop-shadow-md transition"
136
136
>
137
- < UserAvatar src = { member . profile . imageUrl } />
137
+ < UserAvatarWrapper profile = { member . profile } />
138
138
</ div >
139
139
< div className = "flex flex-col w-full" >
140
140
< div className = "flex items-center gap-x-2" >
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ import {
21
21
DialogTitle ,
22
22
} from "@/components/ui/dialog" ;
23
23
import { ScrollArea } from "@/components/ui/scroll-area" ;
24
- import UserAvatar from "@/components/user-avatar" ;
25
24
import { useModal } from "@/hooks/use-modal-store" ;
26
25
import { ServerWithMembersWithProfiles } from "@/types/server" ;
27
26
@@ -39,6 +38,7 @@ import {
39
38
import { MemberRole } from "@prisma/client" ;
40
39
import axios from "axios" ;
41
40
import { useRouter } from "next/navigation" ;
41
+ import UserAvatarWrapper from "../user-avatar-wrapper" ;
42
42
43
43
const roleIcons = {
44
44
GUEST : null ,
@@ -108,10 +108,7 @@ const MembersModal = () => {
108
108
< ScrollArea className = "mt-8 max-h-[420px] pr-6" >
109
109
{ server ?. members ?. map ( ( member ) => (
110
110
< div key = { member ?. id } className = "flex items-center gap-x-2 mb-6" >
111
- < UserAvatar
112
- src = { member ?. profile . imageUrl }
113
- isOnline = { member ?. profile ?. isOnline }
114
- />
111
+ < UserAvatarWrapper profile = { member ?. profile } />
115
112
< div className = "flex flex-col gap-y-1" >
116
113
< div className = "text-xs font-semibold items-center flex gap-x-1" >
117
114
{ member ?. profile . name }
Original file line number Diff line number Diff line change @@ -4,15 +4,14 @@ import { useOnlineStatus } from "@/hooks/use-online-status";
4
4
import { Profile } from "@prisma/client" ;
5
5
import UserAvatar from "./user-avatar" ;
6
6
7
- interface UserAvatarWraperProps {
8
- imageUrl : string ;
7
+ interface UserAvatarWrapperProps {
9
8
profile : Profile ;
10
9
}
11
10
12
- const UserAvatarWraper = ( { imageUrl , profile } : UserAvatarWraperProps ) => {
11
+ const UserAvatarWrapper = ( { profile } : UserAvatarWrapperProps ) => {
13
12
const { isUserOnline } = useOnlineStatus ( profile || ( { } as Profile ) ) ;
14
13
15
- return < UserAvatar src = { imageUrl } isOnline = { isUserOnline } /> ;
14
+ return < UserAvatar src = { profile ?. imageUrl } isOnline = { isUserOnline } /> ;
16
15
} ;
17
16
18
- export default UserAvatarWraper ;
17
+ export default UserAvatarWrapper ;
You can’t perform that action at this time.
0 commit comments