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

Fix/nav #52

Merged
merged 2 commits into from
Jan 8, 2024
Merged
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
1 change: 1 addition & 0 deletions src/components/Event/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ const Container: React.FC<Props> = ({ events, faculty }) => {
{(selectedFaculty !== 0 || searchQuery !== "") && (
<motion.button
className="group absolute right-0 flex items-center justify-center p-2 text-center"
key="clear"
onClick={handleClear}
initial={{ opacity: 0, x: 0 }}
animate={{ opacity: 1, x: "30%" }}
Expand Down
1 change: 1 addition & 0 deletions src/components/Faculties/Selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const Selector: FC<Props> = ({
<motion.button
className="group absolute right-0 flex items-center justify-center p-2 text-center"
onClick={handleClear}
key="clear"
initial={{ x: 0 }}
animate={{ x: "100%" }}
exit={{ x: 0 }}
Expand Down
15 changes: 9 additions & 6 deletions src/components/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ const Nav = () => {
</span>
<div className="hidden gap-6 font-semibold md:flex">
{links.map((link) => {
const path = link === "Home" ? "/" : "/" + link.toLowerCase();
const isCurrentPath = path === window.location.pathname;
const path = link === "Home" ? "" : link.toLowerCase();
const isCurrentPath =
path === window.location.pathname.replaceAll("/", "");
return (
<a
key={link}
href={path}
href={"/" + path}
className={clsx(
"capitalize text-white underline-offset-2 hover:underline",
isCurrentPath && "underline"
Expand Down Expand Up @@ -112,6 +113,7 @@ const Nav = () => {
initial="initial"
animate="animate"
exit="initial"
key="overlay"
transition={{
delayChildren: 0.2,
staggerChildren: 0.1,
Expand All @@ -122,12 +124,13 @@ const Nav = () => {
>
<div className="flex flex-col gap-8 text-center text-xl font-semibold">
{links.map((link) => {
const path = link === "Home" ? "/" : "/" + link.toLowerCase();
const isCurrentPath = path === window.location.pathname;
const path = link === "Home" ? "" : link.toLowerCase();
const isCurrentPath =
path === window.location.pathname.replaceAll("/", "");
return (
<motion.a
key={link}
href={path}
href={"/" + path}
variants={menuVariants}
transition={{
type: "spring",
Expand Down