Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

💄 Show the member's role next to the tier in the space dropdown (#3350)

Luke Vellaa43df153048d
diff --git a/apps/web/src/app/[locale]/(space)/(dashboard)/layout.tsx b/apps/web/src/app/[locale]/(space)/(dashboard)/layout.tsx
index 30734e979..ddb07ffef 100644
--- a/apps/web/src/app/[locale]/(space)/(dashboard)/layout.tsx
+++ b/apps/web/src/app/[locale]/(space)/(dashboard)/layout.tsx
@@ -49,6 +49,7 @@ export default async function Layout({
name: space.name,
image: space.image,
tier: space.tier,
+ role: space.role,
}))}
/>
</SidebarHeader>
diff --git a/apps/web/src/features/space/components/space-dropdown.tsx b/apps/web/src/features/space/components/space-dropdown.tsx
index 6ca87b238..ca85e18b6 100644
--- a/apps/web/src/features/space/components/space-dropdown.tsx
+++ b/apps/web/src/features/space/components/space-dropdown.tsx
@@ -24,8 +24,9 @@ import { Link } from "@/components/link";
import { RouterLoadingIndicator } from "@/components/router-loading-indicator";
import { setActiveSpaceAction } from "@/features/space/actions";
import { useSpace } from "@/features/space/client";
+import { SpaceRole } from "@/features/space/components/space-role";
import { SpaceTierLabel } from "@/features/space/components/space-tier";
-import type { SpaceTier } from "@/features/space/schema";
+import type { MemberRole, SpaceTier } from "@/features/space/schema";
import { Trans } from "@/i18n/client";
import { useSafeAction } from "@/lib/safe-action/client";
import { CreateSpaceDialog } from "./create-space-dialog";
@@ -34,7 +35,13 @@ import { SpaceIcon } from "./space-icon";
export function SpaceDropdown({
spaces,
}: {
- spaces: { id: string; name: string; image?: string; tier: SpaceTier }[];
+ spaces: {
+ id: string;
+ name: string;
+ image?: string;
+ tier: SpaceTier;
+ role: MemberRole;
+ }[];
}) {
const { data: activeSpace } = useSpace();
const [pendingSpaceId, setPendingSpaceId] = React.useState<string>();
@@ -71,8 +78,10 @@ export function SpaceDropdown({
<div className="truncate font-medium text-sm">
{displayedSpace.name}
</div>
- <div className="text-muted-foreground text-xs">
+ <div className="truncate text-muted-foreground text-xs">
<SpaceTierLabel tier={displayedSpace.tier} />
+ {" · "}
+ <SpaceRole role={displayedSpace.role} />
</div>
</div>
<ChevronsUpDownIcon className="text-muted-foreground" />