Skip to content

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

💄 Responsive alert layout and single upgrade alert on members settings (#2708)

Luke Vella9c7b19da532f
diff --git a/apps/web/public/locales/en/app.json b/apps/web/public/locales/en/app.json
index 84ea1a38b..a2eb80e51 100644
--- a/apps/web/public/locales/en/app.json
+++ b/apps/web/public/locales/en/app.json
@@ -345,6 +345,7 @@
"inviteLink": "Invite Link",
"inviteMember": "Invite member",
"inviteMemberDescription": "Invite a new member to your space",
+ "inviteMembersUpsellDescription": "Invite members to manage polls and events together in this space.",
"inviteParticipantLinkInfo": "Anyone with this link will be able to vote on your poll.",
"inviteParticipantsDescription": "Copy and share the invite link to start gathering responses from your participants.",
"invitePending": "An invitation has already been sent to this email address",
@@ -415,7 +416,8 @@
"memberRoleDescription": "Can create and manage all scheduling tools in this space",
"members": "Members",
"membersDescription": "Members have access to your space",
- "membersInactiveDescription": "Members are inactive because this space does not have an active subscription. Upgrade to Pro to restore their access.",
+ "membersInactiveAlertDescription": "These members lost access when this space's Pro subscription ended. Their seats are kept and access is restored when the space is upgraded again.",
+ "membersInactiveAlertTitle": "Members are inactive",
"membersSettingsDescription": "Manage space members, invite new users, and control access permissions.",
"microsoft365": "Microsoft 365",
"minutesAbbreviation": "min",
@@ -508,7 +510,6 @@
"pendingDeletionNotice": "Your account and data will be permanently deleted on {deletionDate}.",
"pendingInvites": "Pending Invites",
"pendingInvitesDescription": "Invite other users to share your space.",
- "pendingInvitesUpgradeDescription": "Upgrade to Pro to invite members to your space.",
"perSeatMonth": "/seat/mo",
"planFree": "Free",
"planHobbyDescription": "For casual users",
diff --git a/apps/web/src/app/[locale]/(space)/settings/members/page-client.tsx b/apps/web/src/app/[locale]/(space)/settings/members/page-client.tsx
index 40ae83d14..2ccd7292d 100644
--- a/apps/web/src/app/[locale]/(space)/settings/members/page-client.tsx
+++ b/apps/web/src/app/[locale]/(space)/settings/members/page-client.tsx
@@ -1,7 +1,12 @@
"use client";
import { posthog } from "@rallly/posthog/client";
-import { Alert, AlertAction, AlertDescription } from "@rallly/ui/alert";
+import {
+ Alert,
+ AlertAction,
+ AlertDescription,
+ AlertTitle,
+} from "@rallly/ui/alert";
import { Badge } from "@rallly/ui/badge";
import { Button } from "@rallly/ui/button";
import { InfoIcon, SparklesIcon } from "lucide-react";
@@ -41,6 +46,7 @@ export function MembersSettingsPageClient() {
const [invites] = trpc.spaces.listInvites.useSuspenseQuery();
const [seats] = trpc.spaces.getSeats.useSuspenseQuery();
const canInviteMembers = space.getAbility().can("invite", "Member");
+ const hasInactiveMembers = space.data.tier === "hobby" && members.total > 1;
return (
<SettingsPage>
@@ -60,17 +66,37 @@ export function MembersSettingsPageClient() {
<PageSection>
<PageSectionContent>
<IfFeatureEnabled feature="billing">
- {space.data.tier === "hobby" && members.total > 1 ? (
- <Alert variant="info">
+ {hasInactiveMembers ? (
+ <Alert>
<InfoIcon />
+ <AlertTitle>
+ <Trans
+ i18nKey="membersInactiveAlertTitle"
+ defaults="Members are inactive"
+ />
+ </AlertTitle>
<AlertDescription>
- <p>
+ <Trans
+ i18nKey="membersInactiveAlertDescription"
+ defaults="These members lost access when this space's Pro subscription ended. Their seats are kept and access is restored when the space is upgraded again."
+ />
+ </AlertDescription>
+ <AlertAction>
+ <Button
+ size="sm"
+ onClick={() => {
+ posthog?.capture(
+ "members_settings:upgrade_button_click",
+ );
+ showPayWall();
+ }}
+ >
<Trans
- i18nKey="membersInactiveDescription"
- defaults="Members are inactive because this space does not have an active subscription. Upgrade to Pro to restore their access."
+ i18nKey="upgradeToPro"
+ defaults="Upgrade to Pro"
/>
- </p>
- </AlertDescription>
+ </Button>
+ </AlertAction>
</Alert>
) : null}
</IfFeatureEnabled>
@@ -121,13 +147,13 @@ export function MembersSettingsPageClient() {
</StackedList>
</PageSectionContent>
</PageSection>
- {!canInviteMembers ? (
+ {!canInviteMembers && !hasInactiveMembers ? (
<Alert variant="primary">
<SparklesIcon />
<AlertDescription>
<Trans
- i18nKey="pendingInvitesUpgradeDescription"
- defaults="Upgrade to Pro to invite members to your space."
+ i18nKey="inviteMembersUpsellDescription"
+ defaults="Invite members to manage polls and events together in this space."
/>
</AlertDescription>
<AlertAction>
@@ -143,7 +169,8 @@ export function MembersSettingsPageClient() {
</Button>
</AlertAction>
</Alert>
- ) : (
+ ) : null}
+ {canInviteMembers ? (
<>
<PageSectionDivider />
<PageSection>
@@ -255,7 +282,7 @@ export function MembersSettingsPageClient() {
</PageSectionContent>
</PageSection>
</>
- )}
+ ) : null}
</PageSectionGroup>
</SettingsPageContent>
</SettingsPage>
diff --git a/packages/ui/src/alert.tsx b/packages/ui/src/alert.tsx
index d981ff5b4..4540f4d67 100644
--- a/packages/ui/src/alert.tsx
+++ b/packages/ui/src/alert.tsx
@@ -5,7 +5,7 @@ import type * as React from "react";
import { cn } from "./lib/utils";
const alertVariants = cva(
- "group/alert relative grid w-full items-center gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-[>svg]:has-data-[slot=alert-action]:grid-cols-[auto_1fr_auto] has-[>svg]:grid-cols-[auto_1fr] has-data-[slot=alert-action]:grid-cols-[1fr_auto] has-data-[slot=alert-title]:items-start has-[>svg]:gap-x-2 has-data-[slot=alert-action]:gap-x-2 *:[svg:not([class*='size-'])]:size-4 *:[svg]:text-current has-data-[slot=alert-title]:*:[svg]:row-span-2 has-data-[slot=alert-title]:*:[svg]:translate-y-0.5",
+ "group/alert relative grid w-full items-center gap-y-2 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-title]:items-start has-data-[slot=alert-action]:gap-x-2 sm:has-[>svg]:has-data-[slot=alert-action]:grid-cols-[auto_1fr_auto] sm:gap-0.5 sm:has-[>svg]:grid-cols-[auto_1fr] sm:has-data-[slot=alert-action]:grid-cols-[1fr_auto] sm:has-[>svg]:gap-x-2 *:[svg:not([class*='size-'])]:size-4 not-has-data-[slot=alert-action]:*:[svg]:self-start *:[svg]:text-current sm:not-has-data-[slot=alert-action]:*:[svg]:translate-y-0.5 sm:has-data-[slot=alert-title]:*:[svg]:row-span-2 sm:has-data-[slot=alert-title]:*:[svg]:translate-y-0.5",
{
variants: {
variant: {
@@ -47,7 +47,7 @@ function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
<div
data-slot="alert-title"
className={cn(
- "font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",
+ "font-medium sm:group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",
className,
)}
{...props}
@@ -63,7 +63,7 @@ function AlertDescription({
<div
data-slot="alert-description"
className={cn(
- "text-balance text-muted-foreground text-sm md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
+ "col-start-1 text-balance text-muted-foreground text-sm sm:group-has-[>svg]/alert:col-start-2 md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
className,
)}
{...props}
@@ -76,7 +76,7 @@ function AlertAction({ className, ...props }: React.ComponentProps<"div">) {
<div
data-slot="alert-action"
className={cn(
- "col-start-2 justify-self-end group-has-[>svg]/alert:col-start-3 group-has-data-[slot=alert-title]/alert:row-span-2 group-has-data-[slot=alert-title]/alert:row-start-1",
+ "col-start-1 justify-self-start sm:col-start-2 sm:justify-self-end sm:group-has-[>svg]/alert:col-start-3 sm:group-has-data-[slot=alert-title]/alert:row-span-2 sm:group-has-data-[slot=alert-title]/alert:row-start-1",
className,
)}
{...props}