feat: implement memo chat frontend (#1938)

* feat: implment backend function

* feat: implment frontend component

* stash

* eslint

* eslint

* eslint

* delete node

* stash

* refactor the style

* eslint

* eslint

* eslint

* fix build error

* add dep

* Update web/src/components/MemosChat/ConversationTab.tsx

Co-authored-by: boojack <stevenlgtm@gmail.com>

* Update web/src/components/MemosChat/ConversationTab.tsx

Co-authored-by: boojack <stevenlgtm@gmail.com>

* feat: change the name

* disable for vistor

---------

Co-authored-by: boojack <stevenlgtm@gmail.com>
This commit is contained in:
CorrectRoadH
2023-07-14 13:09:21 +08:00
committed by GitHub
parent 06dbd87311
commit 39351970d0
17 changed files with 489 additions and 7 deletions

View File

@ -16,6 +16,7 @@ const Home = lazy(() => import("@/pages/Home"));
const MemoDetail = lazy(() => import("@/pages/MemoDetail"));
const EmbedMemo = lazy(() => import("@/pages/EmbedMemo"));
const NotFound = lazy(() => import("@/pages/NotFound"));
const MemosChat = lazy(() => import("@/pages/MemosChat"));
const initialGlobalStateLoader = (() => {
let done = false;
@ -147,6 +148,26 @@ const router = createBrowserRouter([
return null;
},
},
{
path: "memo-chat",
element: <MemosChat />,
loader: async () => {
await initialGlobalStateLoader();
try {
await initialUserState();
} catch (error) {
// do nth
}
const { host } = store.getState().user;
if (isNullorUndefined(host)) {
return redirect("/auth");
}
return null;
},
},
{
path: "archived",
element: <Archived />,