Add UserButton to stack-server

This commit is contained in:
Stan Wohlwend 2024-04-14 10:00:52 +02:00
parent 23bdf623b6
commit 97505250f1
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,7 @@
"use client";
import { Logo } from "@/components/logo";
import { Sheet, SheetProps, Stack } from "@mui/joy";
import { UserButton } from "@stackframe/stack";
export function Header(props: SheetProps & { headerHeight: number }) {
const { headerHeight, ...sheetProps } = props;
@ -20,6 +21,7 @@ export function Header(props: SheetProps & { headerHeight: number }) {
borderRight: 'none',
display: 'flex',
alignItems: 'stretch',
justifyContent: 'space-between',
height: `${headerHeight}px`,
...(sheetProps.sx ?? {}),
}}
@ -27,6 +29,7 @@ export function Header(props: SheetProps & { headerHeight: number }) {
<Stack sx={{ marginLeft: 2, justifyContent: 'center', height: headerHeight - 1 }}>
<Logo full height={24} href="/projects" />
</Stack>
<UserButton />
</Sheet>
);
}

View File

@ -37,8 +37,8 @@ const StyledContent = styled(DropdownMenuPrimitive.Content)<{
`;
const DropdownMenuContent = React.forwardRef<
React.ElementRef<typeof DropdownMenuPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
React.ElementRef<typeof DropdownMenuPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
>(({ className, sideOffset = 4, ...props }, ref) => {
const { colors } = useDesign();
return (