Skip to content

Commit

Permalink
try to fix avatar yet again
Browse files Browse the repository at this point in the history
  • Loading branch information
Magnus Alexander Strømseng committed Apr 10, 2024
1 parent 23095e2 commit 626d5fb
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions frontend/src/app/blog/[articleSlug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { BlocksContent } from "@strapi/blocks-react-renderer";
import BlockRendererClient from "@/components/BlockRendererClient";
import { gql } from "@/__generated__/gql";
import { getClient } from "@/lib/ApolloClient";
import { AvatarImageFix } from "@/components/AvatarImageFix";
import ShareButtons from "@/components/ShareButtons";
import NextImage from "next/image";

const STRAPI_URL = process.env.STRAPI_URL;

Expand Down Expand Up @@ -92,14 +92,18 @@ export default async function Page({
<div className="flex flex-1 justify-start gap-1">
{avatarURL && (
<Avatar className="">
<AvatarImageFix src={avatarURL} alt="Avatar" />
<AvatarFallback>
{// Get initials from author name
authorName
?.split(" ")
.map((name: any) => name[0])
.join("")}
</AvatarFallback>
{avatarURL && (
<NextImage src={avatarURL} alt="Avatar Image" />
)}
{!avatarURL && (
<AvatarFallback>
{// Get initials from author name
authorName
?.split(" ")
.map((name: any) => name[0])
.join("")}
</AvatarFallback>
)}
</Avatar>
)}
<div className="flex flex-col justify-center">
Expand Down

0 comments on commit 626d5fb

Please sign in to comment.