feat: support embed memo with iframe (#912)

This commit is contained in:
boojack
2023-01-07 01:56:02 +08:00
committed by GitHub
parent 0f8ce3dd16
commit 96798e10b4
13 changed files with 164 additions and 13 deletions

View File

@ -8,6 +8,7 @@ const Auth = lazy(() => import("../pages/Auth"));
const Explore = lazy(() => import("../pages/Explore"));
const Home = lazy(() => import("../pages/Home"));
const MemoDetail = lazy(() => import("../pages/MemoDetail"));
const EmbedMemo = lazy(() => import("../pages/EmbedMemo"));
const router = createBrowserRouter([
{
@ -96,6 +97,19 @@ const router = createBrowserRouter([
return null;
},
},
{
path: "/m/:memoId/embed",
element: <EmbedMemo />,
loader: async () => {
try {
await initialGlobalState();
await initialUserState();
} catch (error) {
// do nth
}
return null;
},
},
]);
export default router;