diff --git a/src/App.jsx b/src/App.jsx index 4a9c86f6..3d0c1c8a 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -3,7 +3,7 @@ import Routes from "./routes"; import "./App.less"; import { useFirebase, useFirestore } from "react-redux-firebase"; import { useDispatch, useSelector } from "react-redux"; -import { getProfileData } from "./store/actions"; +import { getProfileData, fetchAndIndexTutorials } from "./store/actions"; const App = () => { const firebase = useFirebase(); @@ -19,6 +19,7 @@ const App = () => { useEffect(() => { getProfileData(organizations)(firebase, firestore, dispatch); + fetchAndIndexTutorials()(firebase, firestore, dispatch); }, [organizations, firebase, dispatch]); return ; }; diff --git a/src/components/NavBar/new/MainNavbar/index.jsx b/src/components/NavBar/new/MainNavbar/index.jsx index 2a41f64d..2ffb2acb 100644 --- a/src/components/NavBar/new/MainNavbar/index.jsx +++ b/src/components/NavBar/new/MainNavbar/index.jsx @@ -61,10 +61,21 @@ function MainNavbar() { const windowSize = useWindowSize(); const [openDrawer, setOpenDrawer] = useState(false); const [openMenu, setOpen] = useState(false); + const [searchQuery, setSearchQuery] = useState(""); const toggleSlider = () => { setOpen(!openMenu); }; const notification = () => {}; + const handleSearchChange = e => { + setSearchQuery(e.target.value); + }; + const handleSearch = e => { + e.preventDefault(); + if (searchQuery.length > 0) { + history.push(`/search?query=${searchQuery}`); + } + }; + return (