Invite page tweaks (#2735)
* Remove buttons, fix web margin issue * generated * Don't share link for non-spaces * generated * Revert "generated" This reverts commit 93907a836d01063cf551f8da0dde2621ab201a62. * Hide share buttons if not space * dart-formatting * delete unused widgets --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: ggurdin <ggurdin@gmail.com>
This commit is contained in:
parent
542afa0506
commit
757ffae1bb
8 changed files with 3 additions and 201 deletions
|
|
@ -54,7 +54,7 @@ class InvitationSelectionView extends StatelessWidget {
|
|||
title: Text(L10n.of(context).inviteContact),
|
||||
// #Pangea
|
||||
actions: [
|
||||
if (room.classCode(context) != null)
|
||||
if (room.isSpace && room.classCode(context) != null)
|
||||
PopupMenuButton<int>(
|
||||
icon: const Icon(Icons.share_outlined),
|
||||
onSelected: (value) async {
|
||||
|
|
|
|||
|
|
@ -90,7 +90,6 @@ class LevelUpBannerState extends State<LevelUpBanner>
|
|||
bool _showedDetails = false;
|
||||
|
||||
ConstructSummary? _constructSummary;
|
||||
bool _loading = true;
|
||||
String? _error;
|
||||
|
||||
@override
|
||||
|
|
@ -151,10 +150,6 @@ class LevelUpBannerState extends State<LevelUpBanner>
|
|||
);
|
||||
} catch (e) {
|
||||
_error = e.toString();
|
||||
} finally {
|
||||
if (mounted) {
|
||||
setState(() => _loading = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import 'package:fluffychat/pages/chat_details/chat_details.dart';
|
|||
import 'package:fluffychat/pages/chat_details/participant_list_item.dart';
|
||||
import 'package:fluffychat/pangea/chat_settings/utils/download_chat.dart';
|
||||
import 'package:fluffychat/pangea/chat_settings/utils/download_file.dart';
|
||||
import 'package:fluffychat/pangea/chat_settings/widgets/class_details_toggle_add_students_tile.dart';
|
||||
import 'package:fluffychat/pangea/chat_settings/widgets/class_name_header.dart';
|
||||
import 'package:fluffychat/pangea/chat_settings/widgets/conversation_bot/conversation_bot_settings.dart';
|
||||
import 'package:fluffychat/pangea/chat_settings/widgets/download_space_analytics_button.dart';
|
||||
|
|
@ -275,7 +274,7 @@ class PangeaChatDetailsView extends StatelessWidget {
|
|||
if (room.canInvite && !room.isDirectChat)
|
||||
ListTile(
|
||||
title: Text(
|
||||
L10n.of(context).inviteStudentByUserName,
|
||||
L10n.of(context).inviteContact,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
|
@ -295,12 +294,6 @@ class PangeaChatDetailsView extends StatelessWidget {
|
|||
),
|
||||
if (room.canInvite && !room.isDirectChat)
|
||||
Divider(color: theme.dividerColor, height: 1),
|
||||
if (room.isSpace && room.isRoomAdmin)
|
||||
SpaceDetailsToggleAddStudentsTile(
|
||||
controller: controller,
|
||||
),
|
||||
if (room.isSpace && room.isRoomAdmin)
|
||||
Divider(color: theme.dividerColor, height: 1),
|
||||
if (isGroupChat && room.isRoomAdmin)
|
||||
ListTile(
|
||||
title: Text(
|
||||
|
|
|
|||
|
|
@ -1,47 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
|
||||
import 'package:fluffychat/pangea/chat_settings/widgets/class_invitation_buttons.dart';
|
||||
import '../../../pages/chat_details/chat_details.dart';
|
||||
|
||||
class SpaceDetailsToggleAddStudentsTile extends StatelessWidget {
|
||||
const SpaceDetailsToggleAddStudentsTile({
|
||||
super.key,
|
||||
required this.controller,
|
||||
});
|
||||
|
||||
final ChatDetailsController controller;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
ListTile(
|
||||
title: Text(
|
||||
L10n.of(context).addStudents,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Theme.of(context).textTheme.bodyLarge!.color,
|
||||
child: const Icon(
|
||||
Icons.add,
|
||||
),
|
||||
),
|
||||
trailing: Icon(
|
||||
controller.displayAddStudentOptions
|
||||
? Icons.keyboard_arrow_down_outlined
|
||||
: Icons.keyboard_arrow_right_outlined,
|
||||
),
|
||||
onTap: controller.toggleAddStudentOptions,
|
||||
),
|
||||
if (controller.displayAddStudentOptions)
|
||||
ClassInvitationButtons(roomId: controller.roomId!),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,131 +0,0 @@
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
import 'package:universal_html/html.dart' as html;
|
||||
|
||||
import 'package:fluffychat/pangea/common/config/environment.dart';
|
||||
import 'package:fluffychat/pangea/extensions/pangea_room_extension.dart';
|
||||
import 'package:fluffychat/pangea/spaces/constants/space_constants.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
|
||||
class ClassInvitationButtons extends StatelessWidget {
|
||||
final String roomId;
|
||||
const ClassInvitationButtons({super.key, required this.roomId});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final Room? room = Matrix.of(context).client.getRoomById(roomId);
|
||||
if (room == null) return Text(L10n.of(context).oopsSomethingWentWrong);
|
||||
|
||||
final copyClassLinkListTile = ListTile(
|
||||
title: Text(
|
||||
L10n.of(context).copyClassLink,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
subtitle: Text(L10n.of(context).copyClassLinkDesc),
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Theme.of(context).textTheme.bodyLarge!.color,
|
||||
child: const Icon(
|
||||
Icons.copy_outlined,
|
||||
),
|
||||
),
|
||||
onTap: () async {
|
||||
final String initialUrl =
|
||||
kIsWeb ? html.window.origin! : Environment.frontendURL;
|
||||
final link =
|
||||
"$initialUrl/#/join_with_link?${SpaceConstants.classCode}=${room.classCode(context)}";
|
||||
await Clipboard.setData(ClipboardData(text: link));
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(L10n.of(context).copiedToClipboard)),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
final spaceCode = room.classCode(context);
|
||||
Widget? copyCodeListTile;
|
||||
if (spaceCode != null) {
|
||||
copyCodeListTile = ListTile(
|
||||
title: Text(
|
||||
"${L10n.of(context).copyClassCode}: $spaceCode",
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
subtitle: Text(L10n.of(context).copyClassCodeDesc),
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Theme.of(context).textTheme.bodyLarge!.color,
|
||||
child: const Icon(
|
||||
Icons.copy,
|
||||
),
|
||||
),
|
||||
onTap: () async {
|
||||
//PTODO-Lala: Standarize toast
|
||||
//PTODO - explore using Fluffyshare for this
|
||||
await Clipboard.setData(ClipboardData(text: spaceCode));
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(L10n.of(context).copiedToClipboard)),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// final inviateWithEmailListTile = ListTile(
|
||||
// enabled: false,
|
||||
// //PTODO - add to copy
|
||||
// title: const Text("Invite with email"),
|
||||
// subtitle: const Text("Coming soon"),
|
||||
// leading: CircleAvatar(
|
||||
// backgroundColor: Theme.of(context).primaryColor,
|
||||
// foregroundColor: Colors.white,
|
||||
// radius: Avatar.defaultSize / 2,
|
||||
// child: const Icon(Icons.email_outlined),
|
||||
// ),
|
||||
// //PTODO: Add invite with email functionality
|
||||
// // onTap: () => VRouter.of(context).to('invite'),
|
||||
// );
|
||||
|
||||
// final addFromGoogleClassooomListTile = ListTile(
|
||||
// enabled: false,
|
||||
// //PTODO - add to copy
|
||||
// title: Text(
|
||||
// L10n.of(context).addFromGoogleClassroom,
|
||||
// style: TextStyle(
|
||||
// color: Theme.of(context).colorScheme.secondary,
|
||||
// fontWeight: FontWeight.bold,
|
||||
// ),
|
||||
// ),
|
||||
// subtitle: Text(L10n.of(context).addFromGoogleClassroomDesc),
|
||||
// leading: CircleAvatar(
|
||||
// backgroundColor: Theme.of(context).primaryColor,
|
||||
// foregroundColor: Colors.white,
|
||||
// radius: Avatar.defaultSize / 2,
|
||||
// child: SvgPicture.asset(
|
||||
// "assets/pangea/google.svg",
|
||||
// height: 20,
|
||||
// width: 20,
|
||||
// ),
|
||||
// ),
|
||||
// //PTODO: Add via google classroom functionality
|
||||
// // onTap: () => VRouter.of(context).to('invite'),
|
||||
// );
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
// inviteStudentByUserNameTile,
|
||||
copyClassLinkListTile,
|
||||
if (copyCodeListTile != null) copyCodeListTile,
|
||||
// inviateWithEmailListTile,
|
||||
// addFromGoogleClassooomListTile,
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -51,7 +51,7 @@ class SpaceInviteButtonsController extends State<SpaceInviteButtons> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final spaceCode = widget.room.classCode(context);
|
||||
if (spaceCode == null) {
|
||||
if (!widget.room.isSpace || spaceCode == null) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import 'package:fluffychat/config/app_config.dart';
|
|||
import 'package:fluffychat/pangea/bot/utils/bot_style.dart';
|
||||
import 'package:fluffychat/pangea/choreographer/enums/span_data_type.dart';
|
||||
import 'package:fluffychat/pangea/choreographer/models/span_data.dart';
|
||||
import 'package:fluffychat/pangea/choreographer/utils/match_copy.dart';
|
||||
import 'package:fluffychat/pangea/choreographer/widgets/igc/card_error_widget.dart';
|
||||
import 'package:fluffychat/pangea/common/utils/error_handler.dart';
|
||||
import 'package:fluffychat/pangea/toolbar/controllers/tts_controller.dart';
|
||||
|
|
@ -215,11 +214,6 @@ class WordMatchContent extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
|
||||
final MatchCopy matchCopy = MatchCopy(
|
||||
context,
|
||||
controller.widget.scm.pangeaMatch!,
|
||||
);
|
||||
|
||||
final ScrollController scrollController = ScrollController();
|
||||
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import 'package:flutter/foundation.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:html_unescape/html_unescape.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:matrix/matrix.dart' as matrix;
|
||||
|
|
@ -28,7 +27,6 @@ import 'package:fluffychat/pangea/common/utils/error_handler.dart';
|
|||
import 'package:fluffychat/pangea/events/models/tokens_event_content_model.dart';
|
||||
import 'package:fluffychat/pangea/extensions/pangea_room_extension.dart';
|
||||
import 'package:fluffychat/pangea/spaces/constants/space_constants.dart';
|
||||
import 'package:fluffychat/pangea/spaces/models/space_model.dart';
|
||||
import '../choreographer/models/choreo_record.dart';
|
||||
import '../events/constants/pangea_event_types.dart';
|
||||
import '../events/models/representation_content_model.dart';
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue