Skip to content

Commit

Permalink
add fallback avatar on header component
Browse files Browse the repository at this point in the history
  • Loading branch information
tnamdevnote committed May 14, 2024
1 parent 877bbdf commit 4139b6a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/(main)/components/heroSection/heroSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ async function HeroSection() {
<section aria-label="Hero" className="relative bg-secondary-15">
<SplitContainer className="py-auto h-[80dvh] min-h-[650px] pt-32 md:h-auto md:flex-row-reverse md:justify-between md:pb-48 md:pt-64 xl:pb-80">
<SplitContainer.Left className="flex basis-1/2 justify-center">
<Image src={barber} width={300} alt="barber image" priority />
<Image src={barber} width={400} alt="barber image" priority />
</SplitContainer.Left>
<SplitContainer.Right className="group flex basis-1/2 flex-col gap-4">
<SplitContainer.Right className="group flex basis-1/2 flex-col gap-4 self-start md:self-center">
<h1
className="animate-fade-in text-left text-lg font-semibold text-primary-100 motion-reduce:animate-none md:text-xl"
style={{ "--index": 2 } as React.CSSProperties}
Expand Down
1 change: 1 addition & 0 deletions public/illustrations/avatar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion shared/organisms/header/header.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use client";

import React, { useEffect, useState } from "react";
import Image from "next/image";
import { LoginLink, LogoutLink } from "@kinde-oss/kinde-auth-nextjs/components";
import { CalendarIcon, LogOutIcon } from "lucide-react";
import { Container } from "@/shared/templates/container";
Expand All @@ -13,6 +14,7 @@ import {
PopoverContent,
PopoverTrigger,
} from "@/shared/molecules/popover";
import avatar from "@/public/illustrations/avatar.svg";

interface HeaderProps {
photo?: string | null;
Expand Down Expand Up @@ -54,7 +56,9 @@ function Header({ photo, isAuthenticated }: HeaderProps) {
<PopoverTrigger className="hover:cursor-pointer" asChild>
<Avatar className="ring-1 ring-neutral-15">
<AvatarImage src={photo ?? ""} alt="profile" />
<AvatarFallback>TN</AvatarFallback>
<AvatarFallback>
<Image src={avatar} width={40} alt="avatar" />
</AvatarFallback>
</Avatar>
</PopoverTrigger>
<PopoverContent
Expand Down

0 comments on commit 4139b6a

Please sign in to comment.