feat(beta): public spaces

This commit is contained in:
Philipinho
2026-09-05 11:25:50 +01:00
parent 5b85464561
commit a12bf42078
117 changed files with 7593 additions and 716 deletions
@@ -2,24 +2,32 @@ import classes from "./switch-space.module.css";
import { useNavigate } from "react-router-dom";
import { SpaceSelect } from "./space-select";
import { getSpaceUrl } from "@/lib/config";
import { Button, Popover, Text } from "@mantine/core";
import { IconChevronDown, IconChevronUp } from "@tabler/icons-react";
import { Button, Popover, Text, Tooltip } from "@mantine/core";
import {
IconChevronDown,
IconChevronUp,
IconWorld,
} from "@tabler/icons-react";
import { useDisclosure } from "@mantine/hooks";
import { CustomAvatar } from "@/components/ui/custom-avatar.tsx";
import { AvatarIconType } from "@/features/attachments/types/attachment.types.ts";
import React from "react";
import { useTranslation } from "react-i18next";
interface SwitchSpaceProps {
spaceName: string;
spaceSlug: string;
spaceIcon?: string;
isPublished?: boolean;
}
export function SwitchSpace({
spaceName,
spaceSlug,
spaceIcon,
isPublished,
}: SwitchSpaceProps) {
const { t } = useTranslation();
const navigate = useNavigate();
const [opened, { close, toggle }] = useDisclosure(false);
@@ -61,6 +69,16 @@ export function SwitchSpace({
<Text className={classes.spaceName} size="md" fw={500} lineClamp={1}>
{spaceName}
</Text>
{isPublished && (
<Tooltip label={t("This space is public")}>
<IconWorld
size={14}
aria-label={t("This space is public")}
style={{ flexShrink: 0 }}
/>
</Tooltip>
)}
</Button>
</Popover.Target>
<Popover.Dropdown>