Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ivy branch #69

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ replacing `your-branch-name` with the name of the branch you created earlier.
### Create a pull request on github and explain what You Have Done in description

Open your github account and click on create pull request button at the top of the page. Then add a descriptive comment on the changes you've made .


Please make the Pull Request in `test-1` branch. Not in the `main`.

<details>


Expand Down
127 changes: 81 additions & 46 deletions components/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,73 +19,108 @@ import { MoonIcon, SunIcon, CloseIcon, HamburgerIcon } from "@chakra-ui/icons";
import { useColorMode } from "@chakra-ui/color-mode";

import NewLogo from "../assets/images/newLogoNoBg.png";
import { useState } from "react";
import { Fragment, useState } from "react";
import { useRouter } from "next/router";

const Navbar = () => {
const { colorMode, toggleColorMode } = useColorMode();
const [menuIcon, setMenuIcon] = useState(true);
const handleMenuClick = () => {
setMenuIcon(!menuIcon);
};
const router = useRouter();
return (
<Flex p="2" borderBottom="1px" borderColor="gray.100">
<Box
fontSize={["lg", "xl", "xl", "2xl"]}
color="#F56565"
fontWeight="bold">
fontWeight="bold"
>
<Stack direction="row" alignItems="center">
<Image boxSize="42px" src={NewLogo.src} alt="logo" />
<Link href="/" paddingLeft="2">
Magic Properties
</Link>
</Stack>
</Box>
<Spacer/>
<Spacer />
<Box>
{/* <IconButton m="auto" aria-label="Toggle Mode" onClick={toggleColorMode}>
{colorMode === "light" ? <MoonIcon /> : <SunIcon />}
</IconButton> */}

<Menu>
<MenuButton
onClick={handleMenuClick}
as={IconButton}
icon={
menuIcon ? (
<HamburgerIcon width={5} height={5} />
) : (
<CloseIcon width={3} height={3} />
)
}
variant="outlined"
color="red.400"
/>
<MenuList>
<Link href="/" passHref>
<MenuItem icon={<FcHome/>}>Home</MenuItem>
</Link>
<Link href="/search" passHref>
<MenuItem icon={<BsSearch/>}>Search</MenuItem>
</Link>
<Link href="/search?purpose=for-sale" passHref>
<MenuItem icon={<FcAbout/>}>Buy Property</MenuItem>
</Link>
<Link href="/search?purpose=for-rent" passHref>
<MenuItem icon={<FiKey/>}>Rent Property</MenuItem>
</Link>
<Link href="/about" passHref>
<MenuItem icon={<FiUserCheck/>}>About Us</MenuItem>
</Link>
<IconButton
width="100%"
alignSelf={"center"}
bg="none"
m="auto"
aria-label="Toggle Mode"
onClick={toggleColorMode}>
{colorMode === "light" ? <MoonIcon /> : <SunIcon />}
</IconButton>
</MenuList>
{({ isOpen }) => (
<Fragment>
<MenuButton
// onClick={handleMenuClick}
as={IconButton}
icon={
!isOpen ? (
<HamburgerIcon width={5} height={5} />
) : (
<CloseIcon width={3} height={3} />
)
}
variant="outlined"
color="red.400"
/>
<MenuList>
<Link href="/" passHref>
<MenuItem
icon={<FcHome />}
backgroundColor={router.asPath === "/" && "#99accb"}
>
Home
</MenuItem>
</Link>
<Link href="/search" passHref>
<MenuItem
icon={<BsSearch />}
backgroundColor={router.asPath === "/search" && "#99accb"}
>
Search
</MenuItem>
</Link>
<Link href="/search?purpose=for-sale" passHref>
<MenuItem
icon={<FcAbout />}
backgroundColor={
router.asPath === "/search?purpose=for-sale" &&
"#99accb"
}
>
Buy Property
</MenuItem>
</Link>
<Link href="/search?purpose=for-rent" passHref>
<MenuItem
icon={<FiKey />}
backgroundColor={
router.asPath === "/search?purpose=for-rent" &&
"#99accb"
}
>
Rent Property
</MenuItem>
</Link>
<Link href="/about" passHref>
<MenuItem
icon={<FiUserCheck />}
backgroundColor={router.asPath === "/about" && "#99accb"}
>
About Us
</MenuItem>
</Link>
<IconButton
width="100%"
alignSelf={"center"}
bg="none"
m="auto"
aria-label="Toggle Mode"
onClick={toggleColorMode}
>
{colorMode === "light" ? <MoonIcon /> : <SunIcon />}
</IconButton>
</MenuList>
</Fragment>
)}
</Menu>
</Box>
</Flex>
Expand Down