From 58720f74aea904144ed04e413e58b5343496e9ab Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Tue, 31 Jan 2023 13:32:49 +0530 Subject: [PATCH] Change design for invite dialog --- .../collection_sharing_actions.dart | 43 ++++++++----------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/lib/ui/actions/collection/collection_sharing_actions.dart b/lib/ui/actions/collection/collection_sharing_actions.dart index 941d2dd81..dfefceb02 100644 --- a/lib/ui/actions/collection/collection_sharing_actions.dart +++ b/lib/ui/actions/collection/collection_sharing_actions.dart @@ -16,6 +16,7 @@ import 'package:photos/theme/ente_theme.dart'; import 'package:photos/ui/common/progress_dialog.dart'; import 'package:photos/ui/components/action_sheet_widget.dart'; import 'package:photos/ui/components/button_widget.dart'; +import 'package:photos/ui/components/dialog_widget.dart'; import 'package:photos/ui/components/models/button_type.dart'; import 'package:photos/ui/payment/subscription.dart'; import 'package:photos/utils/date_time_util.dart'; @@ -214,38 +215,28 @@ class CollectionActions { // getPublicKey can return null // ignore: unnecessary_null_comparison if (publicKey == null || publicKey == '') { - final alertDialog = AlertDialog( - title: const Text("Invite to ente?"), - content: Text( - "Looks like " + - email + - " hasn't signed up for ente yet. would you like to invite them?", - style: const TextStyle( - height: 1.4, - ), - ), - actions: [ - TextButton( - child: Text( - "Invite", - style: TextStyle( - color: Theme.of(context).colorScheme.greenAlternative, - ), - ), - onPressed: () { + await showDialogWidget( + context: context, + title: "Invite to ente", + icon: Icons.info_outline, + body: "$email does not have an ente account\n\nSend them an invite to" + " add them after they sign up", + isDismissible: true, + buttons: [ + ButtonWidget( + buttonType: ButtonType.neutral, + icon: Icons.adaptive.share, + labelText: "Send invite", + isInAlert: true, + onTap: () async { shareText( - "Hey, I have some photos to share. Please install https://ente.io so that I can share them privately.", + "Download ente so we can easily share original quality photos" + " and videos\n\nhttps://ente.io/#download", ); }, ), ], ); - await showDialog( - context: context, - builder: (BuildContext context) { - return alertDialog; - }, - ); return null; } else { if (showProgress) {