mirror of
https://github.com/aykhans/slash-e.git
synced 2025-07-06 21:22:36 +00:00
feat: update root layout
This commit is contained in:
@ -4,7 +4,6 @@ import { userService, workspaceService } from "../services";
|
||||
import { useAppSelector } from "../store";
|
||||
import useLoading from "../hooks/useLoading";
|
||||
import Icon from "../components/Icon";
|
||||
import Header from "../components/Header";
|
||||
import WorkspaceListView from "../components/WorkspaceListView";
|
||||
import CreateWorkspaceDialog from "../components/CreateWorkspaceDialog";
|
||||
|
||||
@ -45,32 +44,29 @@ const Home: React.FC = () => {
|
||||
|
||||
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="mb-4 w-full flex flex-row justify-between items-center">
|
||||
<span className="font-mono text-gray-400">Workspace List</span>
|
||||
</div>
|
||||
{loadingState.isLoading ? (
|
||||
<div className="py-4 w-full flex flex-row justify-center items-center">
|
||||
<Icon.Loader className="mr-2 w-5 h-auto animate-spin" />
|
||||
loading
|
||||
</div>
|
||||
) : workspaceList.length === 0 ? (
|
||||
<div className="w-full flex flex-col justify-center items-center">
|
||||
<Icon.Frown className="mt-8 w-16 h-auto text-gray-400" />
|
||||
<p className="mt-4 text-xl text-gray-600">Oops, no workspace.</p>
|
||||
<button
|
||||
className="mt-4 text-lg flex flex-row justify-start items-center border px-3 py-2 rounded-lg cursor-pointer hover:shadow"
|
||||
onClick={handleCreateWorkspaceButtonClick}
|
||||
>
|
||||
<Icon.Plus className="w-5 h-auto mr-1" /> Create Workspace
|
||||
</button>
|
||||
</div>
|
||||
) : (
|
||||
<WorkspaceListView workspaceList={workspaceList} />
|
||||
)}
|
||||
<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">
|
||||
<span className="font-mono text-gray-400">Workspace List</span>
|
||||
</div>
|
||||
{loadingState.isLoading ? (
|
||||
<div className="py-4 w-full flex flex-row justify-center items-center">
|
||||
<Icon.Loader className="mr-2 w-5 h-auto animate-spin" />
|
||||
loading
|
||||
</div>
|
||||
) : workspaceList.length === 0 ? (
|
||||
<div className="w-full flex flex-col justify-center items-center">
|
||||
<Icon.Frown className="mt-8 w-16 h-auto text-gray-400" />
|
||||
<p className="mt-4 text-xl text-gray-600">Oops, no workspace.</p>
|
||||
<button
|
||||
className="mt-4 text-lg flex flex-row justify-start items-center border px-3 py-2 rounded-lg cursor-pointer hover:shadow"
|
||||
onClick={handleCreateWorkspaceButtonClick}
|
||||
>
|
||||
<Icon.Plus className="w-5 h-auto mr-1" /> Create Workspace
|
||||
</button>
|
||||
</div>
|
||||
) : (
|
||||
<WorkspaceListView workspaceList={workspaceList} />
|
||||
)}
|
||||
</div>
|
||||
|
||||
{state.showCreateWorkspaceDialog && (
|
||||
|
Reference in New Issue
Block a user