fix(settings): improve spacing between navigation child items (#25631)
* fix(settings): improve spacing between navigation child items * chore: removing prettier formatting * style: update dropdown item class names for consistent rounding * style: add spacing and hover margin to navigation items * style: add hover margin top to navigation item * apply same ui changes for team profile menu --------- Co-authored-by: Dhairyashil <[email protected]>
This commit is contained in:
1 parent
ca152d73f2
commit
e1324bd9c3
3 files changed
+176
-54
No files matched your search
+171
-51
@@ -37,13 +37,41 @@ const getTabs = (orgBranding: OrganizationBranding | null) => {
|
||||
href: "/settings/my-account",
|
||||
icon: "user",
|
||||
children: [
|
||||
{ name: "profile", href: "/settings/my-account/profile", trackingMetadata: { section: "my_account", page: "profile" } },
|
||||
{ name: "general", href: "/settings/my-account/general", trackingMetadata: { section: "my_account", page: "general" } },
|
||||
{ name: "calendars", href: "/settings/my-account/calendars", trackingMetadata: { section: "my_account", page: "calendars" } },
|
||||
{ name: "conferencing", href: "/settings/my-account/conferencing", trackingMetadata: { section: "my_account", page: "conferencing" } },
|
||||
{ name: "appearance", href: "/settings/my-account/appearance", trackingMetadata: { section: "my_account", page: "appearance" } },
|
||||
{ name: "out_of_office", href: "/settings/my-account/out-of-office", trackingMetadata: { section: "my_account", page: "out_of_office" } },
|
||||
{ name: "push_notifications", href: "/settings/my-account/push-notifications", trackingMetadata: { section: "my_account", page: "push_notifications" } },
|
||||
{
|
||||
name: "profile",
|
||||
href: "/settings/my-account/profile",
|
||||
trackingMetadata: { section: "my_account", page: "profile" },
|
||||
},
|
||||
{
|
||||
name: "general",
|
||||
href: "/settings/my-account/general",
|
||||
trackingMetadata: { section: "my_account", page: "general" },
|
||||
},
|
||||
{
|
||||
name: "calendars",
|
||||
href: "/settings/my-account/calendars",
|
||||
trackingMetadata: { section: "my_account", page: "calendars" },
|
||||
},
|
||||
{
|
||||
name: "conferencing",
|
||||
href: "/settings/my-account/conferencing",
|
||||
trackingMetadata: { section: "my_account", page: "conferencing" },
|
||||
},
|
||||
{
|
||||
name: "appearance",
|
||||
href: "/settings/my-account/appearance",
|
||||
trackingMetadata: { section: "my_account", page: "appearance" },
|
||||
},
|
||||
{
|
||||
name: "out_of_office",
|
||||
href: "/settings/my-account/out-of-office",
|
||||
trackingMetadata: { section: "my_account", page: "out_of_office" },
|
||||
},
|
||||
{
|
||||
name: "push_notifications",
|
||||
href: "/settings/my-account/push-notifications",
|
||||
trackingMetadata: { section: "my_account", page: "push_notifications" },
|
||||
},
|
||||
// TODO
|
||||
// { name: "referrals", href: "/settings/my-account/referrals" },
|
||||
],
|
||||
@@ -53,16 +81,34 @@ const getTabs = (orgBranding: OrganizationBranding | null) => {
|
||||
href: "/settings/security",
|
||||
icon: "key",
|
||||
children: [
|
||||
{ name: "password", href: "/settings/security/password", trackingMetadata: { section: "security", page: "password" } },
|
||||
{ name: "impersonation", href: "/settings/security/impersonation", trackingMetadata: { section: "security", page: "impersonation" } },
|
||||
{ name: "2fa_auth", href: "/settings/security/two-factor-auth", trackingMetadata: { section: "security", page: "2fa_auth" } },
|
||||
{
|
||||
name: "password",
|
||||
href: "/settings/security/password",
|
||||
trackingMetadata: { section: "security", page: "password" },
|
||||
},
|
||||
{
|
||||
name: "impersonation",
|
||||
href: "/settings/security/impersonation",
|
||||
trackingMetadata: { section: "security", page: "impersonation" },
|
||||
},
|
||||
{
|
||||
name: "2fa_auth",
|
||||
href: "/settings/security/two-factor-auth",
|
||||
trackingMetadata: { section: "security", page: "2fa_auth" },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "billing",
|
||||
href: "/settings/billing",
|
||||
icon: "credit-card",
|
||||
children: [{ name: "manage_billing", href: "/settings/billing", trackingMetadata: { section: "billing", page: "manage_billing" } }],
|
||||
children: [
|
||||
{
|
||||
name: "manage_billing",
|
||||
href: "/settings/billing",
|
||||
trackingMetadata: { section: "billing", page: "manage_billing" },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "developer",
|
||||
@@ -70,9 +116,21 @@ const getTabs = (orgBranding: OrganizationBranding | null) => {
|
||||
icon: "terminal",
|
||||
children: [
|
||||
//
|
||||
{ name: "webhooks", href: "/settings/developer/webhooks", trackingMetadata: { section: "developer", page: "webhooks" } },
|
||||
{ name: "api_keys", href: "/settings/developer/api-keys", trackingMetadata: { section: "developer", page: "api_keys" } },
|
||||
{ name: "admin_api", href: "/settings/organizations/admin-api", trackingMetadata: { section: "developer", page: "admin_api" } },
|
||||
{
|
||||
name: "webhooks",
|
||||
href: "/settings/developer/webhooks",
|
||||
trackingMetadata: { section: "developer", page: "webhooks" },
|
||||
},
|
||||
{
|
||||
name: "api_keys",
|
||||
href: "/settings/developer/api-keys",
|
||||
trackingMetadata: { section: "developer", page: "api_keys" },
|
||||
},
|
||||
{
|
||||
name: "admin_api",
|
||||
href: "/settings/organizations/admin-api",
|
||||
trackingMetadata: { section: "developer", page: "admin_api" },
|
||||
},
|
||||
// TODO: Add profile level for embeds
|
||||
// { name: "embeds", href: "/v2/settings/developer/embeds" },
|
||||
],
|
||||
@@ -97,13 +155,13 @@ const getTabs = (orgBranding: OrganizationBranding | null) => {
|
||||
},
|
||||
...(orgBranding
|
||||
? [
|
||||
{
|
||||
name: "members",
|
||||
href: `${WEBAPP_URL}/settings/organizations/${orgBranding.slug}/members`,
|
||||
isExternalLink: true,
|
||||
trackingMetadata: { section: "organization", page: "members" },
|
||||
},
|
||||
]
|
||||
{
|
||||
name: "members",
|
||||
href: `${WEBAPP_URL}/settings/organizations/${orgBranding.slug}/members`,
|
||||
isExternalLink: true,
|
||||
trackingMetadata: { section: "organization", page: "members" },
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{
|
||||
name: "privacy_and_security",
|
||||
@@ -146,31 +204,83 @@ const getTabs = (orgBranding: OrganizationBranding | null) => {
|
||||
icon: "lock",
|
||||
children: [
|
||||
//
|
||||
{ name: "features", href: "/settings/admin/flags", trackingMetadata: { section: "admin", page: "features" } },
|
||||
{ name: "license", href: "/auth/setup?step=1", trackingMetadata: { section: "admin", page: "license" } },
|
||||
{ name: "impersonation", href: "/settings/admin/impersonation", trackingMetadata: { section: "admin", page: "impersonation" } },
|
||||
{ name: "apps", href: "/settings/admin/apps/calendar", trackingMetadata: { section: "admin", page: "apps" } },
|
||||
{ name: "users", href: "/settings/admin/users", trackingMetadata: { section: "admin", page: "users" } },
|
||||
{ name: "organizations", href: "/settings/admin/organizations", trackingMetadata: { section: "admin", page: "organizations" } },
|
||||
{ name: "lockedSMS", href: "/settings/admin/lockedSMS", trackingMetadata: { section: "admin", page: "locked_sms" } },
|
||||
{ name: "oAuth", href: "/settings/admin/oAuth", trackingMetadata: { section: "admin", page: "oauth" } },
|
||||
{ name: "Workspace Platforms", href: "/settings/admin/workspace-platforms", trackingMetadata: { section: "admin", page: "workspace_platforms" } },
|
||||
{ name: "Playground", href: "/settings/admin/playground", trackingMetadata: { section: "admin", page: "playground" } },
|
||||
{
|
||||
name: "features",
|
||||
href: "/settings/admin/flags",
|
||||
trackingMetadata: { section: "admin", page: "features" },
|
||||
},
|
||||
{
|
||||
name: "license",
|
||||
href: "/auth/setup?step=1",
|
||||
trackingMetadata: { section: "admin", page: "license" },
|
||||
},
|
||||
{
|
||||
name: "impersonation",
|
||||
href: "/settings/admin/impersonation",
|
||||
trackingMetadata: { section: "admin", page: "impersonation" },
|
||||
},
|
||||
{
|
||||
name: "apps",
|
||||
href: "/settings/admin/apps/calendar",
|
||||
trackingMetadata: { section: "admin", page: "apps" },
|
||||
},
|
||||
{
|
||||
name: "users",
|
||||
href: "/settings/admin/users",
|
||||
trackingMetadata: { section: "admin", page: "users" },
|
||||
},
|
||||
{
|
||||
name: "organizations",
|
||||
href: "/settings/admin/organizations",
|
||||
trackingMetadata: { section: "admin", page: "organizations" },
|
||||
},
|
||||
{
|
||||
name: "lockedSMS",
|
||||
href: "/settings/admin/lockedSMS",
|
||||
trackingMetadata: { section: "admin", page: "locked_sms" },
|
||||
},
|
||||
{
|
||||
name: "oAuth",
|
||||
href: "/settings/admin/oAuth",
|
||||
trackingMetadata: { section: "admin", page: "oauth" },
|
||||
},
|
||||
{
|
||||
name: "Workspace Platforms",
|
||||
href: "/settings/admin/workspace-platforms",
|
||||
trackingMetadata: { section: "admin", page: "workspace_platforms" },
|
||||
},
|
||||
{
|
||||
name: "Playground",
|
||||
href: "/settings/admin/playground",
|
||||
trackingMetadata: { section: "admin", page: "playground" },
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
tabs.find((tab) => {
|
||||
if (tab.name === "security" && !HOSTED_CAL_FEATURES) {
|
||||
tab.children?.push({ name: "sso_configuration", href: "/settings/security/sso", trackingMetadata: { section: "security", page: "sso_configuration" } });
|
||||
tab.children?.push({
|
||||
name: "sso_configuration",
|
||||
href: "/settings/security/sso",
|
||||
trackingMetadata: { section: "security", page: "sso_configuration" },
|
||||
});
|
||||
// TODO: Enable dsync for self hosters
|
||||
// tab.children?.push({ name: "directory_sync", href: "/settings/security/dsync" });
|
||||
}
|
||||
if (tab.name === "admin" && IS_CALCOM) {
|
||||
tab.children?.push({ name: "create_org", href: "/settings/organizations/new", trackingMetadata: { section: "admin", page: "create_org" } });
|
||||
tab.children?.push({
|
||||
name: "create_org",
|
||||
href: "/settings/organizations/new",
|
||||
trackingMetadata: { section: "admin", page: "create_org" },
|
||||
});
|
||||
}
|
||||
if (tab.name === "admin" && IS_CALCOM) {
|
||||
tab.children?.push({ name: "create_license_key", href: "/settings/license-key/new", trackingMetadata: { section: "admin", page: "create_license_key" } });
|
||||
tab.children?.push({
|
||||
name: "create_license_key",
|
||||
href: "/settings/license-key/new",
|
||||
trackingMetadata: { section: "admin", page: "create_license_key" },
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -442,8 +552,9 @@ const TeamListCollapsible = ({ teamFeatures }: { teamFeatures?: Record<number, T
|
||||
setTeamMenuState(newTeamMenuState);
|
||||
}
|
||||
}}
|
||||
aria-label={`${team.name} ${teamMenuState[index].teamMenuOpen ? t("collapse_menu") : t("expand_menu")
|
||||
}`}>
|
||||
aria-label={`${team.name} ${
|
||||
teamMenuState[index].teamMenuOpen ? t("collapse_menu") : t("expand_menu")
|
||||
}`}>
|
||||
<div className="me-3">
|
||||
{teamMenuState[index].teamMenuOpen ? (
|
||||
<Icon name="chevron-down" className="h-4 w-4" />
|
||||
@@ -451,7 +562,7 @@ const TeamListCollapsible = ({ teamFeatures }: { teamFeatures?: Record<number, T
|
||||
<Icon name="chevron-right" className="h-4 w-4" />
|
||||
)}
|
||||
</div>
|
||||
{ }
|
||||
{}
|
||||
{!team.parentId && (
|
||||
<Image
|
||||
src={getPlaceholderAvatar(team.logoUrl, team.name)}
|
||||
@@ -469,7 +580,7 @@ const TeamListCollapsible = ({ teamFeatures }: { teamFeatures?: Record<number, T
|
||||
)}
|
||||
</button>
|
||||
</CollapsibleTrigger>
|
||||
<CollapsibleContent className="stack-y-0.5" id={`team-content-${team.id}`}>
|
||||
<CollapsibleContent className="flex flex-col space-y-1" id={`team-content-${team.id}`}>
|
||||
{team.accepted && (
|
||||
<VerticalTabItem
|
||||
name={t("profile")}
|
||||
@@ -494,9 +605,9 @@ const TeamListCollapsible = ({ teamFeatures }: { teamFeatures?: Record<number, T
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore this exists wtf?
|
||||
(team.isOrgAdmin && team.isOrgAdmin)) && (
|
||||
<>
|
||||
{/* TODO */}
|
||||
{/* <VerticalTabItem
|
||||
<>
|
||||
{/* TODO */}
|
||||
{/* <VerticalTabItem
|
||||
name={t("general")}
|
||||
href={`${WEBAPP_URL}/settings/my-account/appearance`}
|
||||
textClassNames="px-3 text-emphasis font-medium text-sm"
|
||||
@@ -628,7 +739,7 @@ const SettingsSidebarContainer = ({
|
||||
className="text-subtle h-[16px] w-[16px] stroke-[2px] ltr:mr-3 rtl:ml-3 md:mt-0"
|
||||
/>
|
||||
)}
|
||||
{ }
|
||||
{}
|
||||
{!tab.icon && tab?.avatar && (
|
||||
<Image
|
||||
width={16}
|
||||
@@ -647,7 +758,7 @@ const SettingsSidebarContainer = ({
|
||||
</Skeleton>
|
||||
</div>
|
||||
</div>
|
||||
<div className="stack-y-px">
|
||||
<div className="flex flex-col space-y-1">
|
||||
{tab.children?.map((child, index) => (
|
||||
<div key={child.href} className="flex items-start gap-2">
|
||||
<VerticalTabItem
|
||||
@@ -772,10 +883,11 @@ const SettingsSidebarContainer = ({
|
||||
setOtherTeamMenuState(newOtherTeamMenuState);
|
||||
}
|
||||
}}
|
||||
aria-label={`${otherTeam.name} ${otherTeamMenuState[index].teamMenuOpen
|
||||
? t("collapse_menu")
|
||||
: t("expand_menu")
|
||||
}`}>
|
||||
aria-label={`${otherTeam.name} ${
|
||||
otherTeamMenuState[index].teamMenuOpen
|
||||
? t("collapse_menu")
|
||||
: t("expand_menu")
|
||||
}`}>
|
||||
<div className="me-3">
|
||||
{otherTeamMenuState[index].teamMenuOpen ? (
|
||||
<Icon name="chevron-down" className="h-4 w-4" />
|
||||
@@ -783,7 +895,7 @@ const SettingsSidebarContainer = ({
|
||||
<Icon name="chevron-right" className="h-4 w-4" />
|
||||
)}
|
||||
</div>
|
||||
{ }
|
||||
{}
|
||||
{!otherTeam.parentId && (
|
||||
<Image
|
||||
src={getPlaceholderAvatar(otherTeam.logoUrl, otherTeam.name)}
|
||||
@@ -797,12 +909,16 @@ const SettingsSidebarContainer = ({
|
||||
</button>
|
||||
</CollapsibleTrigger>
|
||||
<CollapsibleContent
|
||||
className="stack-y-0.5"
|
||||
className="flex flex-col space-y-1"
|
||||
id={`other-team-content-${otherTeam.id}`}>
|
||||
<VerticalTabItem
|
||||
name={t("profile")}
|
||||
href={`/settings/organizations/teams/other/${otherTeam.id}/profile`}
|
||||
trackingMetadata={{ section: "other_team", page: "profile", teamId: otherTeam.id }}
|
||||
trackingMetadata={{
|
||||
section: "other_team",
|
||||
page: "profile",
|
||||
teamId: otherTeam.id,
|
||||
}}
|
||||
textClassNames="px-3 text-emphasis font-medium text-sm"
|
||||
className="px-2! me-5 h-7 w-auto"
|
||||
disableChevron
|
||||
@@ -810,7 +926,11 @@ const SettingsSidebarContainer = ({
|
||||
<VerticalTabItem
|
||||
name={t("members")}
|
||||
href={`/settings/organizations/teams/other/${otherTeam.id}/members`}
|
||||
trackingMetadata={{ section: "other_team", page: "members", teamId: otherTeam.id }}
|
||||
trackingMetadata={{
|
||||
section: "other_team",
|
||||
page: "members",
|
||||
teamId: otherTeam.id,
|
||||
}}
|
||||
textClassNames="px-3 text-emphasis font-medium text-sm"
|
||||
className="px-2! me-5 h-7 w-auto"
|
||||
disableChevron
|
||||
|
||||
@@ -247,7 +247,9 @@ function DropdownItemWithSubmenu({
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
|
||||
return (
|
||||
<DropdownMenuItem className="cursor-pointer" onSelect={onSelect}>
|
||||
<DropdownMenuItem
|
||||
className="cursor-pointer rounded-lg last-of-type:rounded-b-lg"
|
||||
onSelect={onSelect}>
|
||||
<div className="flex items-center">
|
||||
{children}
|
||||
<div className="grow" />
|
||||
|
||||
@@ -105,7 +105,7 @@ export const NavigationItem: React.FC<{
|
||||
<span className="text-subtle px-2 text-xs font-semibold uppercase tracking-wide">
|
||||
{t(item.name)}
|
||||
</span>
|
||||
<div className="flex flex-col">
|
||||
<div className="flex flex-col gap-1">
|
||||
{item.child?.map((childItem) => {
|
||||
const childIsCurrent =
|
||||
typeof childItem.isCurrent === "function"
|
||||
@@ -196,7 +196,7 @@ export const NavigationItem: React.FC<{
|
||||
: `[&[aria-current='page']]:bg-emphasis`,
|
||||
isChild
|
||||
? `[&[aria-current='page']]:text-emphasis [&[aria-current='page']]:bg-emphasis hidden h-8 pl-16 lg:flex lg:pl-11 ${
|
||||
props.index === 0 ? "mt-0" : "mt-px"
|
||||
props.index === 0 ? "mt-0" : "mt-1 hover:mt-1 [&[aria-current='page']]:mt-1"
|
||||
}`
|
||||
: "[&[aria-current='page']]:text-emphasis mt-0.5 text-sm",
|
||||
isLocaleReady
|
||||
|
||||
Reference in new issue
Block a user