Testing avatar
This commit is contained in:
@@ -19,6 +19,7 @@ import { NumberMap, StringMap } from "@/types/typeUtils";
|
||||
import { User } from "@/hooks/get-user";
|
||||
import axios from "axios";
|
||||
import { Avatar, AvatarFallback, AvatarImage } from "./ui/avatar";
|
||||
import ProfilePicture from "./ProfilePicture";
|
||||
|
||||
function MessageContainer({
|
||||
message,
|
||||
@@ -42,17 +43,13 @@ function MessageContainer({
|
||||
<div className="flex flex-col gap-3 rounded-lg p-4 hover:bg-accent">
|
||||
<div className="flex gap-2">
|
||||
{/* <div className="w-8 h-8 rounded-full bg-gray-400" /> */}
|
||||
<Avatar className="h-8 w-8">
|
||||
<AvatarImage
|
||||
src="https://github.com/kleo-dev.png"
|
||||
alt={message.from.toString()}
|
||||
/>
|
||||
<AvatarFallback>
|
||||
{userList[message.from]
|
||||
<ProfilePicture
|
||||
name={String(
|
||||
userList[message.from]
|
||||
? userList[message.from].username
|
||||
: message.from}
|
||||
</AvatarFallback>
|
||||
</Avatar>
|
||||
: message.from
|
||||
)}
|
||||
/>
|
||||
<div className="flex flex-col flex-1">
|
||||
<span className="font-bold flex gap-1 items-center">
|
||||
{userList[message.from]
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import { Avatar, AvatarFallback, AvatarImage } from "./ui/avatar";
|
||||
|
||||
export default function ProfilePicture({ name }: { name: string }) {
|
||||
return (
|
||||
<Avatar className="h-8 w-8">
|
||||
<AvatarImage src="https://github.com/kleo-dev.png" alt={name} />
|
||||
<AvatarFallback>{name[0]}</AvatarFallback>
|
||||
</Avatar>
|
||||
);
|
||||
}
|
||||
@@ -32,6 +32,7 @@ import Channel from "@/types/channel";
|
||||
import Link from "next/link";
|
||||
import { NumberMap } from "@/types/typeUtils";
|
||||
import { User } from "@/hooks/get-user";
|
||||
import ProfilePicture from "./ProfilePicture";
|
||||
|
||||
export default function AppSidebar({
|
||||
user,
|
||||
@@ -204,10 +205,7 @@ export default function AppSidebar({
|
||||
function DMItem({ name, status }: { name: string; status: string }) {
|
||||
return (
|
||||
<Card className="p-2 flex flex-row items-center gap-2 cursor-pointer hover:bg-accent">
|
||||
<Avatar className="h-8 w-8">
|
||||
<AvatarImage src="https://github.com/kleo-dev.png" alt={name} />
|
||||
<AvatarFallback>{name[0]}</AvatarFallback>
|
||||
</Avatar>
|
||||
<ProfilePicture name={name} />
|
||||
<div className="flex flex-col">
|
||||
<span className="text-sm font-medium">{name}</span>
|
||||
<span className="text-xs text-muted-foreground">{status}</span>
|
||||
|
||||
Reference in New Issue
Block a user