mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-18 21:19:44 +00:00
feat: update root layout
This commit is contained in:
parent
77b3f03f5a
commit
c7d345f21d
13
web/src/layout/Root.tsx
Normal file
13
web/src/layout/Root.tsx
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { Outlet } from "react-router-dom";
|
||||||
|
import Header from "../components/Header";
|
||||||
|
|
||||||
|
const UserDetail: React.FC = () => {
|
||||||
|
return (
|
||||||
|
<div className="w-full h-full flex flex-col justify-start items-start">
|
||||||
|
<Header />
|
||||||
|
<Outlet />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default UserDetail;
|
@ -4,7 +4,6 @@ import { userService, workspaceService } from "../services";
|
|||||||
import { useAppSelector } from "../store";
|
import { useAppSelector } from "../store";
|
||||||
import useLoading from "../hooks/useLoading";
|
import useLoading from "../hooks/useLoading";
|
||||||
import Icon from "../components/Icon";
|
import Icon from "../components/Icon";
|
||||||
import Header from "../components/Header";
|
|
||||||
import WorkspaceListView from "../components/WorkspaceListView";
|
import WorkspaceListView from "../components/WorkspaceListView";
|
||||||
import CreateWorkspaceDialog from "../components/CreateWorkspaceDialog";
|
import CreateWorkspaceDialog from "../components/CreateWorkspaceDialog";
|
||||||
|
|
||||||
@ -45,8 +44,6 @@ const Home: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="w-full h-full flex flex-col justify-start items-start">
|
|
||||||
<Header />
|
|
||||||
<div className="mx-auto max-w-4xl w-full px-3 py-6 flex flex-col justify-start items-start">
|
<div className="mx-auto max-w-4xl w-full px-3 py-6 flex flex-col justify-start items-start">
|
||||||
<div className="mb-4 w-full flex flex-row justify-between items-center">
|
<div className="mb-4 w-full flex flex-row justify-between items-center">
|
||||||
<span className="font-mono text-gray-400">Workspace List</span>
|
<span className="font-mono text-gray-400">Workspace List</span>
|
||||||
@ -71,7 +68,6 @@ const Home: React.FC = () => {
|
|||||||
<WorkspaceListView workspaceList={workspaceList} />
|
<WorkspaceListView workspaceList={workspaceList} />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
{state.showCreateWorkspaceDialog && (
|
{state.showCreateWorkspaceDialog && (
|
||||||
<CreateWorkspaceDialog
|
<CreateWorkspaceDialog
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import Header from "../components/Header";
|
|
||||||
import { getShortcutWithNameAndWorkspaceName } from "../helpers/api";
|
import { getShortcutWithNameAndWorkspaceName } from "../helpers/api";
|
||||||
import useLoading from "../hooks/useLoading";
|
import useLoading from "../hooks/useLoading";
|
||||||
|
|
||||||
@ -36,12 +35,9 @@ const ShortcutRedirector: React.FC = () => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return loadingState.isLoading ? null : (
|
return loadingState.isLoading ? null : (
|
||||||
<div className="w-full h-full flex flex-col justify-start items-start">
|
|
||||||
<Header />
|
|
||||||
<div className="w-full pt-24 text-center font-mono text-xl">
|
<div className="w-full pt-24 text-center font-mono text-xl">
|
||||||
<p>{state?.errMessage}</p>
|
<p>{state?.errMessage}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@ import { Button, Input, Tooltip } from "@mui/joy";
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { useAppSelector } from "../store";
|
import { useAppSelector } from "../store";
|
||||||
import Header from "../components/Header";
|
|
||||||
import { showCommonDialog } from "../components/Alert";
|
import { showCommonDialog } from "../components/Alert";
|
||||||
import { userService } from "../services";
|
import { userService } from "../services";
|
||||||
import Icon from "../components/Icon";
|
import Icon from "../components/Icon";
|
||||||
@ -61,8 +60,6 @@ const UserDetail: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="w-full h-full flex flex-col justify-start items-start">
|
|
||||||
<Header />
|
|
||||||
<div className="mx-auto max-w-4xl w-full px-3 py-6 flex flex-col justify-start items-start space-y-4">
|
<div className="mx-auto max-w-4xl w-full px-3 py-6 flex flex-col justify-start items-start space-y-4">
|
||||||
<p className="text-3xl mt-2 mb-4">{user?.displayName}</p>
|
<p className="text-3xl mt-2 mb-4">{user?.displayName}</p>
|
||||||
<p className="leading-8 flex flex-row justify-start items-center">
|
<p className="leading-8 flex flex-row justify-start items-center">
|
||||||
@ -88,7 +85,7 @@ const UserDetail: React.FC = () => {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
{state.showChangePasswordDialog && (
|
{state.showChangePasswordDialog && (
|
||||||
<ChangePasswordDialog
|
<ChangePasswordDialog
|
||||||
onClose={() => {
|
onClose={() => {
|
||||||
|
@ -7,7 +7,6 @@ import useLoading from "../hooks/useLoading";
|
|||||||
import Icon from "../components/Icon";
|
import Icon from "../components/Icon";
|
||||||
import toastHelper from "../components/Toast";
|
import toastHelper from "../components/Toast";
|
||||||
import Dropdown from "../components/common/Dropdown";
|
import Dropdown from "../components/common/Dropdown";
|
||||||
import Header from "../components/Header";
|
|
||||||
import ShortcutListView from "../components/ShortcutListView";
|
import ShortcutListView from "../components/ShortcutListView";
|
||||||
import MemberListView from "../components/MemberListView";
|
import MemberListView from "../components/MemberListView";
|
||||||
import WorkspaceSetting from "../components/WorkspaceSetting";
|
import WorkspaceSetting from "../components/WorkspaceSetting";
|
||||||
@ -72,8 +71,6 @@ const WorkspaceDetail: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="w-full h-full flex flex-col justify-start items-start">
|
|
||||||
<Header />
|
|
||||||
<div className="mx-auto max-w-4xl w-full px-3 pb-6 flex flex-col justify-start items-start">
|
<div className="mx-auto max-w-4xl w-full px-3 pb-6 flex flex-col justify-start items-start">
|
||||||
<div className="w-full flex flex-row justify-between items-center mt-4 mb-4">
|
<div className="w-full flex flex-row justify-between items-center mt-4 mb-4">
|
||||||
<div className="flex flex-row justify-start items-center space-x-3 sm:space-x-4">
|
<div className="flex flex-row justify-start items-center space-x-3 sm:space-x-4">
|
||||||
@ -158,7 +155,6 @@ const WorkspaceDetail: React.FC = () => {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
{state.showCreateShortcutDialog && (
|
{state.showCreateShortcutDialog && (
|
||||||
<CreateShortcutDialog
|
<CreateShortcutDialog
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { createBrowserRouter, redirect } from "react-router-dom";
|
import { createBrowserRouter, redirect } from "react-router-dom";
|
||||||
import { isNullorUndefined } from "../helpers/utils";
|
import { isNullorUndefined } from "../helpers/utils";
|
||||||
import { userService, workspaceService } from "../services";
|
import { userService, workspaceService } from "../services";
|
||||||
|
import Root from "../layout/Root";
|
||||||
import Auth from "../pages/Auth";
|
import Auth from "../pages/Auth";
|
||||||
import Home from "../pages/Home";
|
import Home from "../pages/Home";
|
||||||
import UserDetail from "../pages/UserDetail";
|
import UserDetail from "../pages/UserDetail";
|
||||||
@ -14,6 +15,10 @@ const router = createBrowserRouter([
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/",
|
path: "/",
|
||||||
|
element: <Root />,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: "",
|
||||||
element: <Home />,
|
element: <Home />,
|
||||||
loader: async () => {
|
loader: async () => {
|
||||||
try {
|
try {
|
||||||
@ -61,6 +66,8 @@ const router = createBrowserRouter([
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "/:workspaceName/:shortcutName",
|
path: "/:workspaceName/:shortcutName",
|
||||||
element: <ShortcutRedirector />,
|
element: <ShortcutRedirector />,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user