forked from cerc-io/snowballtools-base
feat: add layout
This commit is contained in:
parent
acf5aab26f
commit
f34eb48d1e
@ -3,23 +3,23 @@ import {
|
|||||||
Link,
|
Link,
|
||||||
Outlet,
|
Outlet,
|
||||||
useLocation,
|
useLocation,
|
||||||
// useNavigate,
|
useNavigate,
|
||||||
useParams,
|
useParams,
|
||||||
} from 'react-router-dom';
|
} from 'react-router-dom';
|
||||||
import { Project as ProjectType } from 'gql-client';
|
import { Project as ProjectType } from 'gql-client';
|
||||||
|
|
||||||
import { Tab, Tabs, TabsBody, TabsHeader } from '@material-tailwind/react';
|
|
||||||
|
|
||||||
import { useGQLClient } from '../../../context/GQLClientContext';
|
import { useGQLClient } from '../../../context/GQLClientContext';
|
||||||
import { useOctokit } from '../../../context/OctokitContext';
|
import { useOctokit } from '../../../context/OctokitContext';
|
||||||
import { Button } from 'components/shared/Button';
|
import { Button } from 'components/shared/Button';
|
||||||
import { ChevronLeft } from 'components/shared/CustomIcon';
|
import { ChevronLeft } from 'components/shared/CustomIcon';
|
||||||
import { WavyBorder } from 'components/shared/WavyBorder';
|
import { WavyBorder } from 'components/shared/WavyBorder';
|
||||||
|
import { Heading } from 'components/shared/Heading';
|
||||||
|
import { Tabs } from 'components/shared/Tabs';
|
||||||
|
|
||||||
const Id = () => {
|
const Id = () => {
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
const { octokit } = useOctokit();
|
const { octokit } = useOctokit();
|
||||||
// const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const client = useGQLClient();
|
const client = useGQLClient();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
@ -64,106 +64,61 @@ const Id = () => {
|
|||||||
<div className="h-full">
|
<div className="h-full">
|
||||||
{project ? (
|
{project ? (
|
||||||
<>
|
<>
|
||||||
<div className="px-6 py-4 flex items-center gap-4">
|
<div className="px-6 py-4 flex justify-between items-center gap-4">
|
||||||
|
<div className="flex items-center justify-center gap-4">
|
||||||
<Button
|
<Button
|
||||||
variant="tertiary"
|
variant="tertiary"
|
||||||
className="rounded-full h-11 w-11 p-0"
|
className="rounded-full h-11 w-11 p-0"
|
||||||
aria-label="Go back"
|
aria-label="Go back"
|
||||||
leftIcon={<ChevronLeft />}
|
leftIcon={<ChevronLeft />}
|
||||||
/>
|
|
||||||
{repoUrl}
|
|
||||||
</div>
|
|
||||||
{/* <div className="flex p-4 gap-4 items-center">
|
|
||||||
<Button
|
|
||||||
variant="outlined"
|
|
||||||
className="rounded-full"
|
|
||||||
onClick={() => navigate(-1)}
|
onClick={() => navigate(-1)}
|
||||||
placeholder={''}
|
/>
|
||||||
>
|
<Heading className="text-2xl font-medium">
|
||||||
{'<'}
|
|
||||||
</Button>
|
|
||||||
<Typography variant="h3" className="grow" placeholder={''}>
|
|
||||||
{project?.name}
|
{project?.name}
|
||||||
</Typography>
|
</Heading>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center justify-center gap-3">
|
||||||
<Link to={repoUrl} target="_blank">
|
<Link to={repoUrl} target="_blank">
|
||||||
<Button
|
<Button className="h-11 transition-colors" variant="tertiary">
|
||||||
className="rounded-full"
|
Open repo
|
||||||
variant="outlined"
|
|
||||||
placeholder={''}
|
|
||||||
>
|
|
||||||
Open Repo
|
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
<Button className="rounded-full" color="blue" placeholder={''}>
|
<Button className="h-11 transition-colors">Go to app</Button>
|
||||||
Go to app
|
</div>
|
||||||
</Button>
|
</div>
|
||||||
</div> */}
|
<WavyBorder />
|
||||||
<WavyBorder className="h-6" />
|
<div className="px-6 ">
|
||||||
{/* <HorizontalLine /> */}
|
<Tabs value={currentTab} className="flex-col pt-6">
|
||||||
<div className="p-4">
|
<Tabs.List>
|
||||||
<Tabs value={currentTab}>
|
<Tabs.Trigger value="">
|
||||||
<TabsHeader
|
<Link to="">Overview</Link>
|
||||||
className="rounded-none border-b border-blue-gray-50 bg-transparent p-0"
|
</Tabs.Trigger>
|
||||||
indicatorProps={{
|
<Tabs.Trigger value="deployments">
|
||||||
className:
|
<Link to="deployments">Deployments</Link>
|
||||||
'bg-transparent border-b-2 border-gray-900 shadow-none rounded-none',
|
</Tabs.Trigger>
|
||||||
}}
|
<Tabs.Trigger value="database">
|
||||||
placeholder={''}
|
<Link to="database">Database</Link>
|
||||||
>
|
</Tabs.Trigger>
|
||||||
<Link to="">
|
<Tabs.Trigger value="integrations">
|
||||||
<Tab
|
<Link to="integrations">Integrations</Link>
|
||||||
value=""
|
</Tabs.Trigger>
|
||||||
className={'p-2 cursor-pointer'}
|
<Tabs.Trigger value="settings">
|
||||||
placeholder={''}
|
<Link to="settings">Settings</Link>
|
||||||
>
|
</Tabs.Trigger>
|
||||||
Overview
|
</Tabs.List>
|
||||||
</Tab>
|
{/* Not wrapping in Tab.Content because we are using Outlet */}
|
||||||
</Link>
|
<div className="py-7">
|
||||||
<Link to="deployments">
|
|
||||||
<Tab
|
|
||||||
value="deployments"
|
|
||||||
className={'p-2 cursor-pointer'}
|
|
||||||
placeholder={''}
|
|
||||||
>
|
|
||||||
Deployments
|
|
||||||
</Tab>
|
|
||||||
</Link>
|
|
||||||
<Link to="database">
|
|
||||||
<Tab
|
|
||||||
value="database"
|
|
||||||
className={'p-2 cursor-pointer'}
|
|
||||||
placeholder={''}
|
|
||||||
>
|
|
||||||
Database
|
|
||||||
</Tab>
|
|
||||||
</Link>
|
|
||||||
<Link to="integrations">
|
|
||||||
<Tab
|
|
||||||
value="integrations"
|
|
||||||
className={'p-2 cursor-pointer'}
|
|
||||||
placeholder={''}
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</Tab>
|
|
||||||
</Link>
|
|
||||||
<Link to="settings">
|
|
||||||
<Tab
|
|
||||||
value="settings"
|
|
||||||
className={'p-2 cursor-pointer'}
|
|
||||||
placeholder={''}
|
|
||||||
>
|
|
||||||
Settings
|
|
||||||
</Tab>
|
|
||||||
</Link>
|
|
||||||
</TabsHeader>
|
|
||||||
<TabsBody placeholder={''}>
|
|
||||||
<Outlet context={{ project, onUpdate }} />
|
<Outlet context={{ project, onUpdate }} />
|
||||||
</TabsBody>
|
</div>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<h4>Project not found</h4>
|
<div className="grid place-items-center h-[calc(100vh-174px)]">
|
||||||
|
<Heading as="h4" className="text-2xl font-medium">
|
||||||
|
Project not found.
|
||||||
|
</Heading>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -115,7 +115,7 @@ const OverviewTabPanel = () => {
|
|||||||
}, [project]);
|
}, [project]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="grid grid-cols-5 gap-[72px] mt-7">
|
<div className="grid grid-cols-5 gap-[72px]">
|
||||||
<div className="col-span-3">
|
<div className="col-span-3">
|
||||||
<div className="flex items-center gap-4 mb-6">
|
<div className="flex items-center gap-4 mb-6">
|
||||||
<Avatar
|
<Avatar
|
||||||
|
Loading…
Reference in New Issue
Block a user