Skip to content

Commit

Permalink
Shot detail page ...
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyG11 committed Feb 13, 2024
1 parent a6ad809 commit 0cba697
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 6 deletions.
40 changes: 34 additions & 6 deletions components/shared/ShotDetailPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from "react";
"use client";
import Image from "next/image";
import { LuMail } from "react-icons/lu";
import React, { useEffect, useState } from "react";

import Avatar from "./Avatar";
import { Button } from "./Button";
Expand All @@ -9,20 +11,46 @@ import { LikeButton } from "./LikeButton";
import ProfileStatus from "./ProfileStatus";
import { FavoriteButton } from "./FavoriteButton";
import { ShotWithProfile } from "@/libs/definitions";
import { IoMdContacts } from "react-icons/io";

interface ShotDetailPageProps {
shot: ShotWithProfile;
}

export default function ShotDetailPage({ shot }: ShotDetailPageProps) {
const [activeLink, setActiveLink] = useState<string | null>(null);
const [toggleNav, setToggleNav] = useState(false);

const [scrollActive, setScrollActive] = useState(false);

useEffect(() => {
const handleScroll = () => {
setScrollActive(window.scrollY > 20);
};

window.addEventListener("scroll", handleScroll);

return () => {
window.removeEventListener("scroll", handleScroll);
};
}, []);

return (
<section className="bg-white ">
<nav className="md:text-sm p-4 lg:mx-auto">
<h1 className="text-2xl font-bold mx-auto lg:max-w-5xl ">
<nav
className={cn(
"md:text-sm lg:mx-auto w-full px-4 transition-all bg-white",
scrollActive && "fixed top-0 shadow-sm py-0 z-50"
)}
>
<h1
className={cn(
"text-2xl font-bold mx-auto lg:max-w-5xl ",
scrollActive && "hidden"
)}
>
{shot.title} At the Airport
</h1>
<div className="lg:max-w-5xl pt-6 md:pt-4 md:gap-x-14 justify-between items-center max-w-screen-xl md:mx-auto flex ">
<div className="lg:max-w-5xl py-2 md:py-0 md:gap-x-14 justify-between items-center max-w-screen-xl md:mx-auto flex ">
<div className="flex items-center flex-row-reverse justify-between md:py-5 md:block">
<ProfileStatus profile={shot.profile} />
</div>
Expand Down Expand Up @@ -87,7 +115,7 @@ export default function ShotDetailPage({ shot }: ShotDetailPageProps) {
"py-2.5 px-6 text-white text-sm font-medium bg-primary flex items-center justify-center"
)}
>
<IoMdContacts className="mx-2 w-4 h-4" />
<LuMail className="icon mx-2 w-4 h-4 " />
Get in touch
</Button>
</div>
Expand Down
1 change: 1 addition & 0 deletions hooks/zustandStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type BlockType =
export type FileData = {
file: File;
type: string;
altText: string;
};

export type BoardDataType = {
Expand Down

0 comments on commit 0cba697

Please sign in to comment.