-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from SpaceyaTech/new-resources-page-build
New resources page build
- Loading branch information
Showing
19 changed files
with
1,091 additions
and
838 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,117 +1,117 @@ | ||
import { useState } from "react"; | ||
import { Link, useLocation } from "react-router-dom"; | ||
|
||
import logo from "../../assets/images/sytLogo.png"; | ||
import menu from "../../assets/images/hamburger-menu.svg"; | ||
|
||
const navLinks = [ | ||
{ | ||
id: 1, | ||
link: "Home", | ||
route: "/", | ||
}, | ||
{ | ||
id: 2, | ||
link: "About Us", | ||
route: "/about-us", | ||
}, | ||
{ | ||
id: 3, | ||
link: "Community", | ||
route: "/community", | ||
}, | ||
{ | ||
id: 4, | ||
link: "Products", | ||
route: "/products", | ||
}, | ||
{ | ||
id: 5, | ||
link: "Blogs", | ||
route: "/blogs", | ||
}, | ||
// { | ||
// id: 6, | ||
// link: "Resources", | ||
// route: "/resources", | ||
// }, | ||
// { | ||
// id: 7, | ||
// link: "Shop", | ||
// route: "/shop", | ||
// }, | ||
// { | ||
// id: 8, | ||
// link: "Donate", | ||
// route: "/donate", | ||
// }, | ||
]; | ||
|
||
const Header2 = () => { | ||
const [showNavlinks, setShowNavlinks] = useState(false); | ||
|
||
const { pathname } = useLocation(); | ||
|
||
return ( | ||
<header className="py-5 md:px-10 px-5 flex items-center justify-between md:shadow-none shadow-md relative max-w-[1440px] md:mx-auto"> | ||
{/* logo */} | ||
<Link to="/"> | ||
<img src={logo} alt="logo" className="md:w-16 w-12" /> | ||
</Link> | ||
|
||
{/* mobile menu */} | ||
<img | ||
src={menu} | ||
alt="logo" | ||
className="md:hidden" | ||
onClick={() => setShowNavlinks((prev) => !prev)} | ||
/> | ||
|
||
{/* mobile navlinks */} | ||
<nav | ||
className="flex flex-col items-start justify-start gap-6 text-base absolute top-[90px] left-0 bg-white border-b w-full h-fit z-[1] p-5 pl-12" | ||
style={ | ||
showNavlinks | ||
? { display: "flex", height: "calc(100vh - 90px)" } | ||
: { display: "none" } | ||
} | ||
> | ||
{navLinks.map(({ link, id, route }) => { | ||
const isActive = pathname === route; | ||
return ( | ||
<Link | ||
key={id} | ||
className={`${ | ||
isActive ? "text-primary underline" : "text-gray-900" | ||
} hover:text-primary hover:underline transition-all duration-300 cursor-pointer`} | ||
to={`${route}`} | ||
onClick={() => setShowNavlinks(false)} | ||
> | ||
{link} | ||
</Link> | ||
); | ||
})} | ||
</nav> | ||
|
||
{/* navlinks */} | ||
<nav className="md:flex hidden items-center gap-5 text-base"> | ||
{navLinks.map(({ id, link, route }) => { | ||
const isActive = pathname === route; | ||
return ( | ||
<Link | ||
key={id} | ||
className={`${ | ||
isActive ? "text-primary underline" : "text-gray-900" | ||
} hover:text-primary hover:underline transition-all duration-300 cursor-pointer`} | ||
to={`${route}`} | ||
> | ||
{link} | ||
</Link> | ||
); | ||
})} | ||
</nav> | ||
</header> | ||
); | ||
}; | ||
|
||
export default Header2; | ||
import { useState } from "react"; | ||
import { Link, useLocation } from "react-router-dom"; | ||
|
||
import logo from "../../assets/images/sytLogo.png"; | ||
import menu from "../../assets/images/hamburger-menu.svg"; | ||
|
||
const navLinks = [ | ||
{ | ||
id: 1, | ||
link: "Home", | ||
route: "/", | ||
}, | ||
{ | ||
id: 2, | ||
link: "About Us", | ||
route: "/about-us", | ||
}, | ||
{ | ||
id: 3, | ||
link: "Community", | ||
route: "/community", | ||
}, | ||
{ | ||
id: 4, | ||
link: "Products", | ||
route: "/products", | ||
}, | ||
{ | ||
id: 5, | ||
link: "Blogs", | ||
route: "/blogs", | ||
}, | ||
// { | ||
// id: 6, | ||
// link: "Resources", | ||
// route: "/resources", | ||
// }, | ||
// { | ||
// id: 7, | ||
// link: "Shop", | ||
// route: "/shop", | ||
// }, | ||
// { | ||
// id: 8, | ||
// link: "Donate", | ||
// route: "/donate", | ||
// }, | ||
]; | ||
|
||
const Header2 = () => { | ||
const [showNavlinks, setShowNavlinks] = useState(false); | ||
|
||
const { pathname } = useLocation(); | ||
|
||
return ( | ||
<header className="py-5 md:px-10 px-5 flex items-center justify-between md:shadow-none shadow-md relative max-w-[1440px] md:mx-auto"> | ||
{/* logo */} | ||
<Link to="/"> | ||
<img src={logo} alt="logo" className="md:w-16 w-12" /> | ||
</Link> | ||
|
||
{/* mobile menu */} | ||
<img | ||
src={menu} | ||
alt="logo" | ||
className="md:hidden" | ||
onClick={() => setShowNavlinks((prev) => !prev)} | ||
/> | ||
|
||
{/* mobile navlinks */} | ||
<nav | ||
className="flex flex-col items-start justify-start gap-6 text-base absolute top-[90px] left-0 bg-white border-b w-full h-fit z-[1] p-5 pl-12" | ||
style={ | ||
showNavlinks | ||
? { display: "flex", height: "calc(100vh - 90px)" } | ||
: { display: "none" } | ||
} | ||
> | ||
{navLinks.map(({ link, id, route }) => { | ||
const isActive = pathname === route; | ||
return ( | ||
<Link | ||
key={id} | ||
className={`${ | ||
isActive ? "text-primary underline" : "text-gray-900" | ||
} hover:text-primary hover:underline transition-all duration-300 cursor-pointer`} | ||
to={`${route}`} | ||
onClick={() => setShowNavlinks(false)} | ||
> | ||
{link} | ||
</Link> | ||
); | ||
})} | ||
</nav> | ||
|
||
{/* navlinks */} | ||
<nav className="md:flex hidden items-center gap-5 text-base"> | ||
{navLinks.map(({ id, link, route }) => { | ||
const isActive = pathname === route; | ||
return ( | ||
<Link | ||
key={id} | ||
className={`${ | ||
isActive ? "text-primary underline" : "text-gray-900" | ||
} hover:text-primary hover:underline transition-all duration-300 cursor-pointer`} | ||
to={`${route}`} | ||
> | ||
{link} | ||
</Link> | ||
); | ||
})} | ||
</nav> | ||
</header> | ||
); | ||
}; | ||
|
||
export default Header2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.