Skip to content

Commit

Permalink
refactor navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua committed Apr 20, 2023
1 parent 8680c39 commit 00d3417
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/components/modals/LoginModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const LoginModal = () => {
onClick={() => signIn("github")}
/>
<div className="justify-center flex flex-row items-center gap-2">
<div>First time using Airbnb?</div>
<div>First time using Holiday?</div>
<div
onClick={toggle}
className="text-neutral-800 cursor-pointer hover:underline"
Expand Down
2 changes: 1 addition & 1 deletion app/components/modals/RegisterModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const RegisterModal = () => {

const bodyContent = (
<div className="flex flex-col gap-4">
<Heading title={"Welcome to Airbnb"} subtitle={"Create an Account!"} />
<Heading title={"Welcome to Holiday"} subtitle={"Create an Account!"} />
<Input
id={"email"}
label={"Email"}
Expand Down
2 changes: 1 addition & 1 deletion app/components/modals/RentModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ const RentModal = () => {
<Modal
disabled={isLoading}
isOpen={rentModal.isOpen}
title="Airbnb your home!"
title="Holiday.com your home!"
actionLabel={actionLabel}
onSubmit={handleSubmit(onSubmit)}
secondaryActionLabel={secondaryActionLabel}
Expand Down
14 changes: 6 additions & 8 deletions app/components/navbar/Logo.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
"use client";
import Image from "next/image";

import { useRouter } from "next/navigation";

const Logo = () => {
const router = useRouter();

return (
<Image
<div
onClick={() => router.push("/")}
alt="Logo"
className="hidden md:block cursor-pointer"
height="100"
width="100"
src="/images/logo.png"
/>
className="text-rose-500 font-extrabold cursor-pointer"
>
HOLIDAY.com
</div>
);
};

Expand Down
8 changes: 5 additions & 3 deletions app/components/navbar/UserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const UserMenu: React.FC<UserMenuProps> = ({ currentUser }) => {
if (!currentUser) {
return loginModal.onOpen();
}
}, [loginModal, currentUser]);
return rentModal.onOpen();
}, [loginModal, currentUser, rentModal]);

return (
<div className="relative">
Expand All @@ -40,14 +41,15 @@ const UserMenu: React.FC<UserMenuProps> = ({ currentUser }) => {
className="hidden md:block text-sm font-semibold py-3 px-4
rounded-full hover:bg-neutral-100 transition cursor-pointer"
>
Airbnb your home
Holiday.com your home
</div>
<div
onClick={toggle}
className="p-4 md:py-1 md:px-2 border-[1px] border-neutral-200 flex flex-row items-center
gap-3 rounded-full cursor-pointer hover:shadow-md transition"
>
<AiOutlineMenu />
<p>{currentUser && currentUser?.name}</p>
<div className="hidden md:block">
<Avatar src={currentUser?.image} />
</div>
Expand Down Expand Up @@ -77,7 +79,7 @@ const UserMenu: React.FC<UserMenuProps> = ({ currentUser }) => {
onClick={() => router.push("/properties")}
label={"My Properties"}
/>
<MenuItem onClick={rentModal.onOpen} label={"Airbnb my home"} />
<MenuItem onClick={rentModal.onOpen} label={"My home"} />
<MenuItem onClick={() => signOut()} label={"Logout"} />
</>
) : (
Expand Down

1 comment on commit 00d3417

@vercel
Copy link

@vercel vercel bot commented on 00d3417 Apr 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.