Skip to content

Commit

Permalink
Merge branch 'preview'
Browse files Browse the repository at this point in the history
  • Loading branch information
pdelfan committed Jan 18, 2024
2 parents 2c4a821 + 5177190 commit 63f8352
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/components/contentDisplay/feedPost/FeedPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default function FeedPost(props: Props) {
}}
className="z-20 shrink-0 hover:brightness-90"
>
<Avatar profile={author} size="md" />
<Avatar src={author.avatar} size="md" />
</Link>
<div className={`flex flex-col grow ${isParent && "pb-6"}`}>
{isParent && !reason && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function NotificationItem(props: Props) {
href={`/dashboard/user/${author.handle}`}
className="max-w-fit hover:brightness-90"
>
<Avatar profile={author} />
<Avatar src={author.avatar} />
</Link>
))}
{allAuthors.length > MAX_AUTHORS_SHOWN && (
Expand Down
2 changes: 1 addition & 1 deletion src/components/contentDisplay/profileCard/ProfileCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function ProfileCard(props: Props) {
<article className="flex flex-col gap-2">
<div className="flex flex-wrap justify-between gap-3">
<div className="flex flex-wrap gap-2 items-start">
<Avatar profile={profile} />
<Avatar src={profile.avatar} />
<div className="flex flex-col">
<h2 className="font-semibold">
{profile?.displayName ?? profile.handle}
Expand Down
2 changes: 1 addition & 1 deletion src/components/contentDisplay/searchPost/SearchPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function SearchPost(props: Props) {
}}
className="z-20 shrink-0 hover:brightness-90"
>
<Avatar profile={author} size="md" />
<Avatar src={author.avatar} size="md" />
</Link>
<div className="flex flex-col grow">
<div className="flex">
Expand Down
2 changes: 1 addition & 1 deletion src/components/contentDisplay/threadPost/ThreadPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default function ThreadPost(props: Props) {
}}
className="z-20 shrink-0 hover:brightness-90"
>
<Avatar profile={author} size="md" />
<Avatar src={author.avatar} size="md" />
</button>
<div className="flex flex-col grow">
<div className="flex flex-col">
Expand Down
7 changes: 3 additions & 4 deletions src/components/dataDisplay/avatar/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import Image from "next/image";
import FallbackAvatar from "@/assets/images/fallbackAvatar.png";
import { getAvatarSize } from "@/lib/utils/image";
import { ProfileViewDetailed } from "@atproto/api/dist/client/types/app/bsky/actor/defs";

interface Props {
size?: AvatarSize;
profile: ProfileViewDetailed | null | undefined;
src?: string;
}
export default function Avatar(props: Props) {
const { size, profile } = props;
const { size, src } = props;
const [width, height] = getAvatarSize(size);

return (
<Image
src={profile?.avatar ?? FallbackAvatar}
src={src ?? FallbackAvatar}
alt="Avatar"
width={width}
height={height}
Expand Down
2 changes: 1 addition & 1 deletion src/components/dataDisplay/postEmbed/RecordEmbed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function RecordEmbed(props: Props) {
<div className="flex flex-col">
<div className="flex">
<span className="flex items-center gap-1">
<Avatar profile={record.author} size="xs" />
<Avatar src={record.author.avatar} size="xs" />
<span className="font-semibold break-all max-w-[90%] shrink-0 line-clamp-1 overflow-ellipsis text-neutral-700">
{record.author.displayName ?? record.author.handle}{" "}
</span>
Expand Down
2 changes: 1 addition & 1 deletion src/components/navigational/aside/Aside.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default async function Aside() {
href={`/dashboard/user/${profile?.handle}`}
className="max-w-[7rem] truncate hover:brightness-90"
>
<Avatar profile={profile} />
<Avatar src={profile?.avatar} />
</Link>
</div>
</aside>
Expand Down
2 changes: 1 addition & 1 deletion src/components/navigational/topBar/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function TopBar(props: Props) {
href={`/dashboard/user/${profile?.handle}`}
className="hover:brightness-90"
>
<Avatar profile={profile} size="sm" />
<Avatar src={profile.avatar} size="sm" />
</Link>
<Button
onClick={() => window.scrollTo({ top: 0, behavior: "smooth" })}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default async function SettingsContainer() {
<div className="flex flex-col gap-3 p-3 mt-2 w-full rounded-none md:rounded-t-2xl md:rounded-b-2xl border border-x-0 md:border-x">
<div className="flex flex-wrap gap-3 justify-between items-center ">
<div className="flex gap-3">
<Avatar profile={profile} size="md" />
<Avatar src={profile.avatar} size="md" />
<div className="flex flex-col">
<span className="font-semibold break-all max-w-[90%] shrink-0 line-clamp-1 overflow-ellipsis text-neutral-700">
{profile.displayName ?? profile.handle}
Expand Down

0 comments on commit 63f8352

Please sign in to comment.