mirror of
https://github.com/docmost/docmost.git
synced 2025-11-14 05:01:15 +10:00
* stripe init git submodules for enterprise modules * * Cloud billing UI - WIP * Proxy websockets in dev mode * Separate workspace login and creation for cloud * Other fixes * feat: billing (cloud) * * add domain service * prepare links from workspace hostname * WIP * Add exchange token generation * Validate JWT token type during verification * domain service * add SkipTransform decorator * * updates (server) * add new packages * new sso migration file * WIP * Fix hostname generation * WIP * WIP * Reduce input error font-size * set max password length * jwt package * license page - WIP * * License management UI * Move license key store to db * add reflector * SSO enforcement * * Add default plan * Add usePlan hook * * Fix auth container margin in mobile * Redirect login and home to select page in cloud * update .gitignore * Default to yearly * * Trial messaging * Handle ended trials * Don't set to readonly on collab disconnect (Cloud) * Refine trial (UI) * Fix bug caused by using jotai optics atom in AppHeader component * configurable database maximum pool * Close SSO form on save * wip * sync * Only show sign-in in cloud * exclude base api part from workspaceId check * close db connection beforeApplicationShutdown * Add health/live endpoint * clear cookie on hostname change * reset currentUser atom * Change text * return 401 if workspace does not match * feat: show user workspace list in cloud login page * sync * Add home path * Prefetch to speed up queries * * Add robots.txt * Disallow login and forgot password routes * wildcard user-agent * Fix space query cache * fix * fix * use space uuid for recent pages * prefetch billing plans * enhance license page * sync
113 lines
3.1 KiB
TypeScript
113 lines
3.1 KiB
TypeScript
import { Group, Menu, UnstyledButton, Text } from "@mantine/core";
|
|
import {
|
|
IconBrush,
|
|
IconChevronDown,
|
|
IconLogout,
|
|
IconSettings,
|
|
IconUserCircle,
|
|
IconUsers,
|
|
} from "@tabler/icons-react";
|
|
import { useAtom } from "jotai";
|
|
import { currentUserAtom } from "@/features/user/atoms/current-user-atom.ts";
|
|
import { Link } from "react-router-dom";
|
|
import APP_ROUTE from "@/lib/app-route.ts";
|
|
import useAuth from "@/features/auth/hooks/use-auth.ts";
|
|
import { CustomAvatar } from "@/components/ui/custom-avatar.tsx";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
export default function TopMenu() {
|
|
const { t } = useTranslation();
|
|
const [currentUser] = useAtom(currentUserAtom);
|
|
const { logout } = useAuth();
|
|
|
|
const user = currentUser?.user;
|
|
const workspace = currentUser?.workspace;
|
|
|
|
if (!user || !workspace) {
|
|
return <></>;
|
|
}
|
|
|
|
return (
|
|
<Menu width={250} position="bottom-end" withArrow shadow={"lg"}>
|
|
<Menu.Target>
|
|
<UnstyledButton>
|
|
<Group gap={7} wrap={"nowrap"}>
|
|
<CustomAvatar
|
|
avatarUrl={workspace?.logo}
|
|
name={workspace?.name}
|
|
variant="filled"
|
|
size="sm"
|
|
/>
|
|
<Text fw={500} size="sm" lh={1} mr={3} lineClamp={1}>
|
|
{workspace?.name}
|
|
</Text>
|
|
<IconChevronDown size={16} />
|
|
</Group>
|
|
</UnstyledButton>
|
|
</Menu.Target>
|
|
<Menu.Dropdown>
|
|
<Menu.Label>{t("Workspace")}</Menu.Label>
|
|
|
|
<Menu.Item
|
|
component={Link}
|
|
to={APP_ROUTE.SETTINGS.WORKSPACE.GENERAL}
|
|
leftSection={<IconSettings size={16} />}
|
|
>
|
|
{t("Workspace settings")}
|
|
</Menu.Item>
|
|
|
|
<Menu.Item
|
|
component={Link}
|
|
to={APP_ROUTE.SETTINGS.WORKSPACE.MEMBERS}
|
|
leftSection={<IconUsers size={16} />}
|
|
>
|
|
{t("Manage members")}
|
|
</Menu.Item>
|
|
|
|
<Menu.Divider />
|
|
|
|
<Menu.Label>{t("Account")}</Menu.Label>
|
|
<Menu.Item component={Link} to={APP_ROUTE.SETTINGS.ACCOUNT.PROFILE}>
|
|
<Group wrap={"nowrap"}>
|
|
<CustomAvatar
|
|
size={"sm"}
|
|
avatarUrl={user.avatarUrl}
|
|
name={user.name}
|
|
/>
|
|
|
|
<div style={{width: 190}}>
|
|
<Text size="sm" fw={500} lineClamp={1}>
|
|
{user.name}
|
|
</Text>
|
|
<Text size="xs" c="dimmed" truncate="end">
|
|
{user.email}
|
|
</Text>
|
|
</div>
|
|
</Group>
|
|
</Menu.Item>
|
|
<Menu.Item
|
|
component={Link}
|
|
to={APP_ROUTE.SETTINGS.ACCOUNT.PROFILE}
|
|
leftSection={<IconUserCircle size={16} />}
|
|
>
|
|
{t("My profile")}
|
|
</Menu.Item>
|
|
|
|
<Menu.Item
|
|
component={Link}
|
|
to={APP_ROUTE.SETTINGS.ACCOUNT.PREFERENCES}
|
|
leftSection={<IconBrush size={16} />}
|
|
>
|
|
{t("My preferences")}
|
|
</Menu.Item>
|
|
|
|
<Menu.Divider />
|
|
|
|
<Menu.Item onClick={logout} leftSection={<IconLogout size={16} />}>
|
|
{t("Logout")}
|
|
</Menu.Item>
|
|
</Menu.Dropdown>
|
|
</Menu>
|
|
);
|
|
}
|