Separate invites from profile navigation
Magent CI/CD / verify (push) Successful in 10m56s
Magent CI/CD / deploy-prod (push) Skipped
Magent CI/CD / deploy-beta (push) Successful in 15s

This commit is contained in:
2026-09-01 19:51:02 +12:00
parent 7ed0f4b103
commit 0ed22dd315
2 changed files with 3 additions and 56 deletions
+2 -50
View File
@@ -3,7 +3,6 @@
import { useRouter } from 'next/navigation'
import { useEffect, useMemo, useState } from 'react'
import { authFetch, clearToken, getApiBase, getToken } from '../../lib/auth'
import { useUserViewPreview } from '../../lib/viewMode'
type ProfileInfo = {
username: string
@@ -98,7 +97,6 @@ export default function ProfileInvitesPage() {
const [inviteManagedByMaster, setInviteManagedByMaster] = useState(false)
const [masterInviteTemplate, setMasterInviteTemplate] = useState<OwnedInvitesResponse['master_invite']>(null)
const [loading, setLoading] = useState(true)
const viewAsUser = useUserViewPreview()
const signupBaseUrl = useMemo(() => {
if (typeof window === 'undefined') return '/signup'
@@ -317,54 +315,8 @@ export default function ProfileInvitesPage() {
<main className="card">
<div className="user-directory-panel-header profile-page-header">
<div>
<h1>{viewAsUser ? 'Invites' : 'My invites'}</h1>
<p className="lede">
{viewAsUser
? 'Preview the invite workspace exactly as a permitted non-admin user sees it.'
: 'Create invite links, email them directly, and track who you have invited.'}
</p>
</div>
<div className="admin-inline-actions">
<button type="button" className="ghost-button" onClick={() => router.push('/profile')}>
Back to profile
</button>
</div>
</div>
{profile && viewAsUser ? (
<div className="status-banner">
<strong>User view preview.</strong> The non-admin presentation is active. Your admin permissions and invite data remain unchanged.
</div>
) : profile ? (
<div className="status-banner">
Signed in as <strong>{profile.username}</strong> ({profile.role}).
</div>
) : null}
<div className="profile-tabbar">
<div className="admin-segmented" role="tablist" aria-label="Profile sections">
<button type="button" role="tab" aria-selected={false} onClick={() => router.push('/profile')}>
Overview
</button>
<button
type="button"
role="tab"
aria-selected={false}
onClick={() => router.push('/profile?tab=activity')}
>
Activity
</button>
<button type="button" role="tab" aria-selected className="is-active">
My invites
</button>
<button
type="button"
role="tab"
aria-selected={false}
onClick={() => router.push('/profile?tab=security')}
>
Security
</button>
<h1>Invites</h1>
<p className="lede">Create invite links, email them directly, and track who you have invited.</p>
</div>
</div>