refactor(web): CreateInviteModal — icon-badge header + uppercase section labels + dominant submit
This commit is contained in:
@@ -468,18 +468,32 @@ function CreateInviteModal({ onClose, onCreated }: CreateInviteModalProps) {
|
|||||||
className="relative w-full max-w-md mx-4 glass-modal rounded-lg animate-slide-up overflow-hidden"
|
className="relative w-full max-w-md mx-4 glass-modal rounded-lg animate-slide-up overflow-hidden"
|
||||||
onClick={(e) => e.stopPropagation()}
|
onClick={(e) => e.stopPropagation()}
|
||||||
>
|
>
|
||||||
|
{/* Header */}
|
||||||
|
<div className="px-5 pt-5 pb-4 border-b border-white/[0.06] flex items-start gap-3">
|
||||||
|
<div className="w-10 h-10 rounded-lg bg-accent-lavender/15 flex items-center justify-center flex-shrink-0">
|
||||||
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="text-accent-lavender">
|
||||||
|
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" />
|
||||||
|
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<div className="min-w-0">
|
||||||
|
<h3 className="text-[16px] font-bold text-txt-primary">Create invite link</h3>
|
||||||
|
<p className="text-[13px] text-txt-secondary leading-snug mt-0.5">
|
||||||
|
Generate a shareable link that lets people register on this instance. You'll set how many times it can be used and when it expires.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<form
|
<form
|
||||||
onSubmit={(e) => {
|
onSubmit={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
handleCreate();
|
handleCreate();
|
||||||
}}
|
}}
|
||||||
className="p-6 space-y-5"
|
className="px-5 pt-4 pb-5 space-y-5"
|
||||||
>
|
>
|
||||||
<h3 className="text-lg font-semibold text-txt-primary">Create invite link</h3>
|
|
||||||
|
|
||||||
{/* Name */}
|
{/* Name */}
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-sm text-txt-secondary mb-1.5">Name</label>
|
<div className="text-[11px] font-semibold text-txt-tertiary uppercase tracking-wider mb-2">Name</div>
|
||||||
<input
|
<input
|
||||||
ref={nameInputRef}
|
ref={nameInputRef}
|
||||||
type="text"
|
type="text"
|
||||||
@@ -494,7 +508,7 @@ function CreateInviteModal({ onClose, onCreated }: CreateInviteModalProps) {
|
|||||||
|
|
||||||
{/* Max uses */}
|
{/* Max uses */}
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-sm text-txt-secondary mb-1.5">Max uses</label>
|
<div className="text-[11px] font-semibold text-txt-tertiary uppercase tracking-wider mb-2">Max uses</div>
|
||||||
<div className="flex items-center gap-4">
|
<div className="flex items-center gap-4">
|
||||||
<label className="flex items-center gap-2 text-sm cursor-pointer">
|
<label className="flex items-center gap-2 text-sm cursor-pointer">
|
||||||
<input
|
<input
|
||||||
@@ -534,6 +548,8 @@ function CreateInviteModal({ onClose, onCreated }: CreateInviteModalProps) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Expiry */}
|
{/* Expiry */}
|
||||||
|
<div>
|
||||||
|
<div className="text-[11px] font-semibold text-txt-tertiary uppercase tracking-wider mb-2">Expires</div>
|
||||||
<ExpirySelector
|
<ExpirySelector
|
||||||
value={expiryId}
|
value={expiryId}
|
||||||
customDateTime={customDateTime}
|
customDateTime={customDateTime}
|
||||||
@@ -547,21 +563,22 @@ function CreateInviteModal({ onClose, onCreated }: CreateInviteModalProps) {
|
|||||||
showKeep={false}
|
showKeep={false}
|
||||||
disabled={submitting}
|
disabled={submitting}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Actions */}
|
{/* Actions */}
|
||||||
<div className="flex justify-end gap-2 pt-1">
|
<div className="flex gap-2 mt-4">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
disabled={submitting}
|
disabled={submitting}
|
||||||
className="px-3 py-1.5 text-sm text-txt-secondary hover:text-txt-primary transition-colors disabled:opacity-50"
|
className="py-2.5 px-4 rounded-lg text-[13px] font-medium text-txt-tertiary border border-white/[0.06] hover:bg-white/[0.06] transition-colors disabled:opacity-50"
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={submitting}
|
disabled={submitting}
|
||||||
className="px-4 py-1.5 bg-accent-primary hover:bg-accent-primary/80 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50"
|
className="flex-1 py-2.5 rounded-lg text-[13px] font-semibold text-white bg-accent-primary hover:bg-accent-primary/80 transition-colors disabled:opacity-50"
|
||||||
>
|
>
|
||||||
{submitting ? 'Creating…' : 'Create link'}
|
{submitting ? 'Creating…' : 'Create link'}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user