Skip to content

Commit

Permalink
Merge pull request #878 from acm-ucr/menthy/nav
Browse files Browse the repository at this point in the history
  • Loading branch information
shahdivyank authored Nov 17, 2023
2 parents f8e9c9f + 2fcbec7 commit 8972bf5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/app/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Upcoming from "@/components/static/upcoming/Upcoming";

const Home = () => {
return (
<>
<div className="w-full">
<Release release={RELEASES.STATIC.UPCOMING}>
<Upcoming />
</Release>
Expand All @@ -20,7 +20,7 @@ const Home = () => {
<Release release={RELEASES.STATIC.POSTLIVE}>
<Postlive />
</Release>
</>
</div>
);
};

Expand Down
18 changes: 11 additions & 7 deletions src/components/dynamic/Navigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import { BiSolidDownArrow } from "react-icons/bi";
const Navigation = () => {
const [expand, setExpand] = useState(false);
const pathName = usePathname();
const tabs = TABS[pathName.split("/")[1]];
const [dropdown, setDropdown] = useState(Object.keys(tabs)[0]);
const [tabs, setTabs] = useState(TABS[pathName.split("/")[1]]);

return (
<>
Expand Down Expand Up @@ -50,23 +49,28 @@ const Navigation = () => {
</div>
<div className="w-full flex flex-col items-center h-full">
{Object.entries(tabs)
.filter(([title]) => title !== " ")
.filter(([title]) => title !== " " && title !== "dropdown")
.map(([title, subTabs], index) => (
<div key={index} className="w-full">
<p
className={`text-white text-xl font-poppin font-bold w-full px-2 mb-0 flex items-center justify-between hover:cursor-pointer ${subTabs.mt}`}
onClick={() => setDropdown(title === dropdown ? "" : title)}
onClick={() =>
setTabs({
...tabs,
[title]: { ...subTabs, expand: !subTabs.expand },
})
}
>
{title}
{subTabs.expand && (
{tabs.dropdown && (
<BiSolidDownArrow
className={`text-sm duration-300 ${
dropdown === title && "rotate-180"
subTabs.expand && "rotate-180"
}`}
/>
)}
</p>
{(dropdown === title || !subTabs.expand) &&
{(subTabs.expand || !tabs.dropdown) &&
subTabs.tabs.map((tab, index) => (
<Link
key={index}
Expand Down
4 changes: 4 additions & 0 deletions src/data/Releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ const DEV = {
"/form/mentor": new Date("10/01/2023"),
"/form/admin": new Date("10/01/2023"),
"/form/committee": new Date("10/01/2023"),
"/form/feedback": new Date("10/01/2023"),
"/form/interest": new Date("10/01/2023"),

"/user/checkin": new Date("10/01/2023"),
"/user/dashboard": new Date("10/01/2023"),
Expand Down Expand Up @@ -87,6 +89,8 @@ const PRODUCTION = {
"/form/mentor": new Date("10/01/2023"),
"/form/admin": new Date("10/01/2023"),
"/form/committee": new Date("10/01/2023"),
"/form/feedback": new Date("10/01/2023"),
"/form/interest": new Date("10/01/2023"),

"/user/checkin": new Date("10/01/2023"),
"/user/dashboard": new Date("10/01/2023"),
Expand Down
1 change: 1 addition & 0 deletions src/data/dynamic/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const iconStyle = "mr-2";

export const TABS = {
admin: {
dropdown: true,
Dashboards: {
expand: true,
mt: "mt-0",
Expand Down

0 comments on commit 8972bf5

Please sign in to comment.