Files
spacedrive/interface/app/$libraryId/settings/ModalLayout.tsx
Brendan Allan c65d92ee4c [ENG-380] Interface code structure improvement (#581)
* beginnings of app directory

* settings mostly good

* colocate way more components

* flatten components folder

* reexport QueryClientProvider from client

* move CodeBlock back to interface

* colocate Explorer, KeyManager + more

* goddamn captialisation

* get toasts out of components

* please eslint

* no more src directory

* $ instead of :

* added back RowHeader component

* fix settings modal padding

* more spacing, less margin

* fix sidebar locations button

* fix tags sidebar link

* clean up back button

* added margin to explorer context menu to prevent contact with edge of viewport

* don't export QueryClientProvider from @sd/client

* basic guidelines

* import interface correctly

* remove old demo data

* fix onboarding layout

* fix onboarding navigation

* fix key manager settings button

---------

Co-authored-by: Jamie Pine <ijamespine@me.com>
2023-02-27 21:29:48 -08:00

46 lines
1.3 KiB
TypeScript

import { CaretLeft } from 'phosphor-react';
import { PropsWithChildren } from 'react';
import { useNavigate } from 'react-router';
import { Button, Divider, tw } from '@sd/ui';
interface Props extends PropsWithChildren {
title: string;
topRight?: React.ReactNode;
}
const PageOuter = tw.div`flex h-screen flex-col m-3 -mt-4`;
const Page = tw.div`flex-1 w-full border rounded-md shadow-md shadow-app-shade/30 border-app-box bg-app-box/20`;
const PageInner = tw.div`flex flex-col max-w-4xl w-full h-screen py-6`;
const HeaderArea = tw.div`flex flex-row px-8 items-center space-x-4 mb-2`;
const ContentContainer = tw.div`px-8 pt-5 -mt-1 space-y-6 custom-scroll page-scroll`;
export default ({ children, title, topRight }: Props) => (
<PageOuter>
<Page>
<PageInner>
<HeaderArea>
<BackButton />
<h3 className="grow text-lg font-semibold">{title}</h3>
{topRight}
</HeaderArea>
<div className="px-8">
<Divider />
</div>
<ContentContainer>{children}</ContentContainer>
</PageInner>
</Page>
</PageOuter>
);
const BackButton = () => {
const navigate = useNavigate();
return (
<Button variant="outline" size="icon" onClick={() => navigate(-1)}>
<div className="flex h-4 w-4 justify-center">
<CaretLeft weight="bold" className="text-ink-dull w-[12px] " aria-hidden="true" />
</div>
</Button>
);
};