feat(client): declutter space sidebar and global header
- Remove the large active-space name header in the space sidebar;
the active space stays highlighted in the spaces grid below.
- Move "Space settings" into the user avatar (top) menu next to
"Workspace settings"; it shows only while viewing a space and is
detected via useMatch("/s/:spaceSlug/*").
- Make the brand logo non-selectable/non-draggable (user-select:none
on .brand, draggable=false on the img).
- Remove the redundant "Home" button next to the logo (the logo
already links to /home).
- Remove the version label under the Settings sidebar menu.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -87,7 +87,6 @@ export function SpaceSidebar() {
|
||||
spaceName={space?.name}
|
||||
spaceSlug={space?.slug}
|
||||
spaceIcon={space?.logo}
|
||||
onSettings={openSettings}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -2,16 +2,6 @@
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.header {
|
||||
padding: rem(4px) var(--mantine-spacing-sm);
|
||||
}
|
||||
|
||||
.spaceName {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
color: light-dark(var(--mantine-color-dark-4), var(--mantine-color-dark-0));
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import classes from "./switch-space.module.css";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { getSpaceUrl } from "@/lib/config";
|
||||
import { ActionIcon, Group, Text, Tooltip, UnstyledButton } from "@mantine/core";
|
||||
import { IconSettings } from "@tabler/icons-react";
|
||||
import { Text, UnstyledButton } from "@mantine/core";
|
||||
import { CustomAvatar } from "@/components/ui/custom-avatar.tsx";
|
||||
import { AvatarIconType } from "@/features/attachments/types/attachment.types.ts";
|
||||
import {
|
||||
@@ -10,7 +9,6 @@ import {
|
||||
useGetSpacesQuery,
|
||||
} from "@/features/space/queries/space-query.ts";
|
||||
import { ISpace } from "../../types/space.types";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import clsx from "clsx";
|
||||
import React, { useMemo } from "react";
|
||||
|
||||
@@ -19,7 +17,6 @@ interface SwitchSpaceProps {
|
||||
spaceName: string;
|
||||
spaceSlug: string;
|
||||
spaceIcon?: string;
|
||||
onSettings: () => void;
|
||||
}
|
||||
|
||||
export function SwitchSpace({
|
||||
@@ -27,9 +24,7 @@ export function SwitchSpace({
|
||||
spaceName,
|
||||
spaceSlug,
|
||||
spaceIcon,
|
||||
onSettings,
|
||||
}: SwitchSpaceProps) {
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
// Load every space the user belongs to (API caps limit at 100) and render
|
||||
// them as an always-visible grid instead of the previous searchable popover.
|
||||
@@ -59,31 +54,6 @@ export function SwitchSpace({
|
||||
|
||||
return (
|
||||
<div className={classes.wrapper}>
|
||||
<Group gap={6} wrap="nowrap" className={classes.header}>
|
||||
<CustomAvatar
|
||||
name={spaceName}
|
||||
avatarUrl={spaceIcon}
|
||||
type={AvatarIconType.SPACE_ICON}
|
||||
color="initials"
|
||||
variant="filled"
|
||||
size={20}
|
||||
/>
|
||||
<Text className={classes.spaceName} size="md" fw={600} lineClamp={1}>
|
||||
{spaceName}
|
||||
</Text>
|
||||
<Tooltip label={t("Space settings")} withArrow position="top">
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
color="gray"
|
||||
size="sm"
|
||||
onClick={onSettings}
|
||||
aria-label={t("Space settings")}
|
||||
>
|
||||
<IconSettings size={18} stroke={2} />
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
</Group>
|
||||
|
||||
<div className={classes.grid}>
|
||||
{spaces.map((space: ISpace) => (
|
||||
<UnstyledButton
|
||||
|
||||
Reference in New Issue
Block a user