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

dev-server #127

Open
wants to merge 7 commits into
base: dev-server
Choose a base branch
from
Open
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
27 changes: 24 additions & 3 deletions src/Components/Navbar/Mobile.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import React from "react";
import NavLinks from "./NavLinks";
import Notification from "./Notification";
import { links } from "./Mylinks";
import { getLinks } from "./Mylinks";
import SearchBar from "./SearchBar";
import { useState } from "react";
import { useCallback } from "react";
import SheetAPI from "../../Utils/SheetAPI";
import { useEffect } from "react";
export const MobileTopBar = ({ setNotificationOpen, notificationOpen, handleScrolling, setOpen, open }) => {

function menuCloseEvent() {
setOpen(!open);
setNotificationOpen(false);
Expand Down Expand Up @@ -69,7 +73,7 @@ export const MobileMenu = ({ setNotificationOpen, setOpen, handleScrolling, open
className="py-3 px-28 "
>
<button className="bg-orange-400 text-white px-6 py-2 rounded-md ">
Join Discord
Join µLearn
</button>
</a>
<a
Expand Down Expand Up @@ -106,10 +110,27 @@ export const MobileView = ({ visible, setVisibility, prev, setPrev, currentLink,
)
}
export const MobileNavHeader = ({ visible, test1 }) => {
const [variable, setVariable] = useState([])
const ig = variable.map(link => {
if (link.parent === 'null')
return ({
name: link?.heading,
link: `https://learn.mulearn.org/${link?.code}`,
})
else return {}
})
const Sheet = useCallback(() => {
SheetAPI('https://docs.google.com/spreadsheets/d/1C7MyDDpRCIq3bnXi-bdWQrUdYMJ0_2cBkpoJ7POQA6A/edit#gid=0', 'landing_pages', setVariable)
}, [])
useEffect(() => {
if (variable.length <= 0)
Sheet()
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [variable.length])
return (
<>
{!visible &&
links.map((link, index) => (
getLinks(ig).map((link, index) => (
<div key={index} className={`px-7 py-5 text-left flex justify-between items-center }`} onClick={() => { test1(link); }}>
<h1 className="text-[13px]">{link.name}</h1>
<span className="text-[13px] flex items-center" onClick={() => { test1(link); }} >
Expand Down
Loading