Skip to content

Commit

Permalink
[frontend] replace userToolTip to Avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
kotto5 committed Jan 30, 2024
1 parent 0dc9563 commit 830281a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions frontend/app/ui/room/message-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { MessageEvent } from "@/app/lib/dtos";
import { Avatar } from "@/app/ui/user/avatar";
import { Stack } from "@/components/layout/stack";
import { TooltipProvider } from "@radix-ui/react-tooltip";
import UserTooltip from "../user/user-tool-tip";

export function MessageItem({
message,
Expand All @@ -18,7 +17,11 @@ export function MessageItem({
{/* Left Side */}
{withAvatar && (
<TooltipProvider>
<UserTooltip user={message.user} avatarSize="medium"></UserTooltip>
<Avatar
avatarURL={message.user.avatarURL}
size="medium"
href={`/user/${message.user.id}`}
></Avatar>
</TooltipProvider>
)}
{!withAvatar && (
Expand Down
1 change: 1 addition & 0 deletions frontend/app/ui/user/match-history.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default async function MatchHistory({ userId }: { userId: number }) {
<ProfileItem title="Match History">
<div className="flex flex-col gap-2">
{history.map((match) => {
// TODO: player2 が undefinedでerrorになる
return (
<div key={match.id} className="flex gap-8 items-center">
<MatchDetailItem
Expand Down
3 changes: 2 additions & 1 deletion frontend/app/ui/user/user-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export default function UserList({
const fetchOnlineStatus = async () => {
try {
users.forEach(async (u) => {
const online = await isOnline(u.id);
const body = await isOnline(u.id);
const online = body.isOnline;
setOnlineStatus((prev) => ({ ...prev, [u.name]: online }));
});
} catch (error) {
Expand Down

0 comments on commit 830281a

Please sign in to comment.