fix: Positioning on wide settings header

This commit is contained in:
Tom Moor
2023-12-19 10:55:19 -05:00
parent c3429bdbbd
commit 1c0e396cd1
6 changed files with 28 additions and 14 deletions

View File

@@ -4,6 +4,7 @@ import breakpoint from "styled-components-breakpoint";
type Props = { type Props = {
children?: React.ReactNode; children?: React.ReactNode;
maxWidth?: string;
withStickyHeader?: boolean; withStickyHeader?: boolean;
}; };
@@ -18,18 +19,24 @@ const Container = styled.div<Props>`
`}; `};
`; `;
const Content = styled.div` type ContentProps = { $maxWidth?: string };
max-width: 46em;
const Content = styled.div<ContentProps>`
max-width: ${(props) => props.$maxWidth ?? "46em"};
margin: 0 auto; margin: 0 auto;
${breakpoint("desktopLarge")` ${breakpoint("desktopLarge")`
max-width: 52em; max-width: ${(props: ContentProps) => props.$maxWidth ?? "52em"};
`}; `};
`; `;
const CenteredContent: React.FC<Props> = ({ children, ...rest }: Props) => ( const CenteredContent: React.FC<Props> = ({
children,
maxWidth,
...rest
}: Props) => (
<Container {...rest}> <Container {...rest}>
<Content>{children}</Content> <Content $maxWidth={maxWidth}>{children}</Content>
</Container> </Container>
); );

View File

@@ -33,7 +33,7 @@ const Scene: React.FC<Props> = ({
centered, centered,
wide, wide,
}: Props) => ( }: Props) => (
<FillWidth $wide={wide}> <FillWidth>
<PageTitle title={textTitle || title} /> <PageTitle title={textTitle || title} />
<Header <Header
hasSidebar hasSidebar
@@ -49,17 +49,18 @@ const Scene: React.FC<Props> = ({
actions={actions} actions={actions}
left={left} left={left}
/> />
{centered !== false && wide !== true ? ( {centered !== false ? (
<CenteredContent withStickyHeader>{children}</CenteredContent> <CenteredContent maxWidth={wide ? "100vw" : undefined} withStickyHeader>
{children}
</CenteredContent>
) : ( ) : (
children children
)} )}
</FillWidth> </FillWidth>
); );
const FillWidth = styled.div<{ $wide?: boolean }>` const FillWidth = styled.div`
width: 100%; width: 100%;
${(props) => props.$wide && `padding: 0px 32px 16px;`}
`; `;
export default Scene; export default Scene;

View File

@@ -195,7 +195,7 @@ function UserMenu({ user }: Props) {
}, },
{ {
type: "button", type: "button",
title: t("Activate account"), title: t("Activate user"),
onClick: handleActivate, onClick: handleActivate,
visible: !user.isInvited && user.isSuspended, visible: !user.isInvited && user.isSuspended,
}, },

View File

@@ -164,6 +164,7 @@ function Members() {
)} )}
</> </>
} }
wide
> >
<Heading>{t("Members")}</Heading> <Heading>{t("Members")}</Heading>
<Text type="secondary"> <Text type="secondary">

View File

@@ -58,8 +58,13 @@ function PeopleTable({ canManage, ...rest }: Props) {
Cell: observer(({ row }: { row: { original: User } }) => ( Cell: observer(({ row }: { row: { original: User } }) => (
<Badges> <Badges>
{!row.original.lastActiveAt && <Badge>{t("Invited")}</Badge>} {!row.original.lastActiveAt && <Badge>{t("Invited")}</Badge>}
{row.original.isAdmin && <Badge primary>{t("Admin")}</Badge>} {row.original.isAdmin ? (
{row.original.isViewer && <Badge>{t("Viewer")}</Badge>} <Badge primary>{t("Admin")}</Badge>
) : row.original.isViewer ? (
<Badge>{t("Viewer")}</Badge>
) : (
<Badge>{t("Editor")}</Badge>
)}
{row.original.isSuspended && <Badge>{t("Suspended")}</Badge>} {row.original.isSuspended && <Badge>{t("Suspended")}</Badge>}
</Badges> </Badges>
)), )),

View File

@@ -414,7 +414,7 @@
"User options": "User options", "User options": "User options",
"Resend invite": "Resend invite", "Resend invite": "Resend invite",
"Revoke invite": "Revoke invite", "Revoke invite": "Revoke invite",
"Activate account": "Activate account", "Activate user": "Activate user",
"template": "template", "template": "template",
"document": "document", "document": "document",
"published": "published", "published": "published",