adding data listening, user getching and using more of recoil

This commit is contained in:
Arjun Patel
2022-02-03 17:14:22 -08:00
parent 4b65d6cd68
commit 6a6f0f4aef
20 changed files with 302 additions and 517 deletions
+10 -1
View File
@@ -1,5 +1,5 @@
import { useRouter } from "next/router";
import React, { ReactElement } from "react";
import React, { ReactElement, useEffect } from "react";
import Conversations from "../../components/MainTabsOrPages/Conversations";
import Done from "../../components/MainTabsOrPages/Done";
import Drawer from "../../components/MainTabsOrPages/Drawer";
@@ -14,9 +14,18 @@ import SearchResults from "../../components/FullPageExperiences/SearchResults";
import { QueryRoutes, Routes } from "@nirvana/common/helpers/routes";
import ViewConvo from "../../components/MainTabsOrPages/ViewConvo";
import MainRecoilDataHandler from "../../recoil/MainRecoilDataHandler";
import { useAuth } from "../../contexts/authContext";
export default function Me() {
// TODO: if not authenticated, take user away
const { currUser } = useAuth();
useEffect(() => {
if (!currUser) {
console.log("not authenticated...routing from dashboard to teams home");
router.push("/teams/login");
return;
}
}, []);
// figure out what content to render from here
const router = useRouter();