mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-03 10:37:48 +09:00
Closes #4430 ## Todo - [ ] Better empty state in projects - [ ] Opening some of those things like video tutorials or support hub in an iframe directly in the dashboard - [ ] Search - [ ] published domain ## Steps for reproduction 1. click button 2. expect xyz ## Code Review - [ ] hi @kof, I need you to do - conceptual review (architecture, feature-correctness) - detailed review (read every line) - test it on preview ## Before requesting a review - [ ] made a self-review - [ ] added inline comments where things may be not obvious (the "why", not "what") ## Before merging - [ ] tested locally and on preview environment (preview dev login: 0000) - [ ] updated [test cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md) document - [ ] added tests - [ ] if any new env variables are added, added them to `.env` file
44 lines
995 B
TypeScript
44 lines
995 B
TypeScript
import type { ComponentProps } from "react";
|
|
import { Flex, theme } from "@webstudio-is/design-system";
|
|
|
|
export const Header = ({
|
|
variant,
|
|
...props
|
|
}: { variant: "aside" | "main" } & ComponentProps<typeof Flex>) => {
|
|
return (
|
|
<Flex
|
|
as="header"
|
|
align="center"
|
|
justify="between"
|
|
shrink={false}
|
|
css={{
|
|
paddingInline:
|
|
variant === "aside" ? theme.spacing[5] : theme.spacing[13],
|
|
height: theme.spacing[19],
|
|
position: "sticky",
|
|
top: 0,
|
|
background: theme.colors.backgroundPanel,
|
|
zIndex: 1,
|
|
}}
|
|
{...props}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export const Main = (props: ComponentProps<typeof Flex>) => {
|
|
return (
|
|
<Flex
|
|
direction="column"
|
|
as="main"
|
|
grow
|
|
css={{
|
|
// Allows scrolling most parent container while header stays sticky
|
|
overflow: "auto",
|
|
// Keeps dialogs on top of the main content
|
|
isolation: "isolate",
|
|
}}
|
|
{...props}
|
|
/>
|
|
);
|
|
};
|