Changes for demo purposes

Add login button to login page, demo mode env variable and fix update indicator
This commit is contained in:
ajnart
2023-10-25 15:18:40 +02:00
parent 7690572c7b
commit ea9c74ea11
4 changed files with 30 additions and 6 deletions

View File

@@ -39,7 +39,7 @@ export const AvatarMenu = () => {
<Menu width={256}>
<Menu.Target>
<CurrentUserAvatar
newVersionAvailable={newVersionAvailable !== undefined}
newVersionAvailable={newVersionAvailable ? true : false}
user={sessionData?.user ?? null}
/>
</Menu.Target>
@@ -128,12 +128,20 @@ const CurrentUserAvatar = forwardRef<HTMLDivElement, CurrentUserAvatarProps>(
({ user, newVersionAvailable, ...others }, ref) => {
const { primaryColor } = useMantineTheme();
if (!user) return <Avatar ref={ref} {...others} />;
if (!newVersionAvailable)
return (
<Indicator withBorder offset={2} color="blue" processing size={15}>
<Avatar ref={ref} color={primaryColor} {...others}>
{user.name?.slice(0, 2).toUpperCase()}
</Avatar>
</Indicator>
);
return (
<Indicator color="blue" processing size={10} hidden={!newVersionAvailable}>
<Avatar ref={ref} color={primaryColor} {...others}>
{user.name?.slice(0, 2).toUpperCase()}
</Avatar>
</Indicator>
<Avatar ref={ref} color={primaryColor} {...others}>
{user.name?.slice(0, 2).toUpperCase()}
</Avatar>
);
}
);