Make invite form always visible in Organization Settings dialog, with send button enabled only if user has manage permission; reposition copy link button next to invite link text for sleeker layout
This commit is contained in:
@@ -449,7 +449,6 @@ class _OrganizationSettingsDialogState
|
||||
],
|
||||
|
||||
// Invite form
|
||||
if (_canManage) ...[
|
||||
const Divider(),
|
||||
Text(
|
||||
'Invite New User',
|
||||
@@ -518,19 +517,15 @@ class _OrganizationSettingsDialogState
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
ModernGlassButton(
|
||||
onPressed: () {
|
||||
onPressed: _canManage ? () {
|
||||
final username = usernameController.text.trim();
|
||||
if (username.isNotEmpty) {
|
||||
_inviteUser(username, selectedRole);
|
||||
usernameController.clear();
|
||||
}
|
||||
},
|
||||
} : null,
|
||||
child: const Text('Send Invitation'),
|
||||
),
|
||||
],
|
||||
|
||||
// Invite link section
|
||||
if (_inviteLink != null) ...[
|
||||
const Divider(),
|
||||
Text(
|
||||
'Invite Link',
|
||||
@@ -540,25 +535,27 @@ class _OrganizationSettingsDialogState
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
'https://b0esche.cloud/join?token=${_inviteLink ?? ''}',
|
||||
style: TextStyle(color: AppTheme.secondaryText),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Row(
|
||||
children: [
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
ModernGlassButton(
|
||||
onPressed: _copyInviteLink,
|
||||
child: const Text('Copy Link'),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
if (_canManage)
|
||||
ModernGlassButton(
|
||||
onPressed: _regenerateInviteLink,
|
||||
child: const Text('Regenerate'),
|
||||
),
|
||||
],
|
||||
),
|
||||
] else if (_canManage) ...[
|
||||
const Divider(),
|
||||
const Text('No invite link available'),
|
||||
|
||||
Reference in New Issue
Block a user