Update invitation acceptance UI for clarity
Updated the invitation acceptance interface components. The 'Join Team' button text has been changed to reflect the user's email. This provides the user more clarity about which account they are accepting the invitation for. Other minor adjustments were made to the layout and heading level for consistency and improved readability.
This commit is contained in:
@@ -94,8 +94,11 @@ async function JoinTeamAccountPage({ searchParams }: Context) {
|
|||||||
invitation.account.slug,
|
invitation.account.slug,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const email = auth.data.email ?? '';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AcceptInvitationContainer
|
<AcceptInvitationContainer
|
||||||
|
email={email}
|
||||||
inviteToken={token}
|
inviteToken={token}
|
||||||
invitation={invitation}
|
invitation={invitation}
|
||||||
paths={{
|
paths={{
|
||||||
|
|||||||
@@ -152,7 +152,7 @@
|
|||||||
"signInWithDifferentAccountDescription": "If you wish to accept the invitation with a different account, please sign out and back in with the account you wish to use.",
|
"signInWithDifferentAccountDescription": "If you wish to accept the invitation with a different account, please sign out and back in with the account you wish to use.",
|
||||||
"acceptInvitationHeading": "Accept Invitation to join {{accountName}}",
|
"acceptInvitationHeading": "Accept Invitation to join {{accountName}}",
|
||||||
"acceptInvitationDescription": "You have been invited to join the team {{accountName}}. If you wish to accept the invitation, please click the button below.",
|
"acceptInvitationDescription": "You have been invited to join the team {{accountName}}. If you wish to accept the invitation, please click the button below.",
|
||||||
"joinTeam": "Join {{accountName}}",
|
"continueAs": "Continue as {{email}}",
|
||||||
"joinTeamAccount": "Join Team",
|
"joinTeamAccount": "Join Team",
|
||||||
"joiningTeam": "Joining team...",
|
"joiningTeam": "Joining team...",
|
||||||
"leaveTeamInputLabel": "Please type LEAVE to confirm leaving the team.",
|
"leaveTeamInputLabel": "Please type LEAVE to confirm leaving the team.",
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { SignOutInvitationButton } from './sign-out-invitation-button';
|
|||||||
|
|
||||||
export function AcceptInvitationContainer(props: {
|
export function AcceptInvitationContainer(props: {
|
||||||
inviteToken: string;
|
inviteToken: string;
|
||||||
|
email: string;
|
||||||
|
|
||||||
invitation: {
|
invitation: {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -29,7 +30,7 @@ export function AcceptInvitationContainer(props: {
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<div className={'flex flex-col items-center space-y-4'}>
|
<div className={'flex flex-col items-center space-y-4'}>
|
||||||
<Heading className={'text-center'} level={5}>
|
<Heading className={'text-center'} level={4}>
|
||||||
<Trans
|
<Trans
|
||||||
i18nKey={'teams:acceptInvitationHeading'}
|
i18nKey={'teams:acceptInvitationHeading'}
|
||||||
values={{
|
values={{
|
||||||
@@ -59,7 +60,7 @@ export function AcceptInvitationContainer(props: {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={'flex flex-col space-y-2.5'}>
|
<div className={'flex flex-col space-y-4'}>
|
||||||
<form
|
<form
|
||||||
data-test={'join-team-form'}
|
data-test={'join-team-form'}
|
||||||
className={'w-full'}
|
className={'w-full'}
|
||||||
@@ -73,7 +74,10 @@ export function AcceptInvitationContainer(props: {
|
|||||||
value={props.paths.accountHome}
|
value={props.paths.accountHome}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<InvitationSubmitButton accountName={props.invitation.account.name} />
|
<InvitationSubmitButton
|
||||||
|
email={props.email}
|
||||||
|
accountName={props.invitation.account.name}
|
||||||
|
/>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<Separator />
|
<Separator />
|
||||||
|
|||||||
@@ -5,15 +5,19 @@ import { useFormStatus } from 'react-dom';
|
|||||||
import { Button } from '@kit/ui/button';
|
import { Button } from '@kit/ui/button';
|
||||||
import { Trans } from '@kit/ui/trans';
|
import { Trans } from '@kit/ui/trans';
|
||||||
|
|
||||||
export function InvitationSubmitButton(props: { accountName: string }) {
|
export function InvitationSubmitButton(props: {
|
||||||
|
accountName: string;
|
||||||
|
email: string;
|
||||||
|
}) {
|
||||||
const { pending } = useFormStatus();
|
const { pending } = useFormStatus();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button type={'submit'} className={'w-full'} disabled={pending}>
|
<Button type={'submit'} className={'w-full'} disabled={pending}>
|
||||||
<Trans
|
<Trans
|
||||||
i18nKey={pending ? 'teams:joiningTeam' : 'teams:joinTeam'}
|
i18nKey={pending ? 'teams:joiningTeam' : 'teams:continueAs'}
|
||||||
values={{
|
values={{
|
||||||
accountName: props.accountName,
|
accountName: props.accountName,
|
||||||
|
email: props.email,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
Reference in New Issue
Block a user