From 0698659646c124473e4a590e891d8a588115ca89 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho <32248947+thiagocarvalhodev@users.noreply.github.com> Date: Mon, 7 Oct 2024 11:00:21 -0300 Subject: [PATCH 1/2] update share drive style --- lib/components/details_panel.dart | 7 +- lib/components/drive_share_dialog.dart | 139 ++++++++++++------------- 2 files changed, 70 insertions(+), 76 deletions(-) diff --git a/lib/components/details_panel.dart b/lib/components/details_panel.dart index 41feae5c6c..d591fd4690 100644 --- a/lib/components/details_panel.dart +++ b/lib/components/details_panel.dart @@ -1249,21 +1249,22 @@ class _CopyButtonState extends State { OverlayEntry _createOverlayEntry(BuildContext parentContext) { final RenderBox button = context.findRenderObject() as RenderBox; final Offset buttonPosition = button.localToGlobal(Offset.zero); + final typography = ArDriveTypographyNew.of(context); + final colorTokens = ArDriveTheme.of(context).themeData.colorTokens; return OverlayEntry( builder: (context) => Positioned( left: buttonPosition.dx - widget.positionX, top: buttonPosition.dy - widget.positionY, child: Material( - color: widget.copyMessageColor ?? - ArDriveTheme.of(context).themeData.backgroundColor, + color: widget.copyMessageColor ?? colorTokens.containerL1, borderRadius: BorderRadius.circular(20), child: Container( padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4), child: Center( child: Text( 'Copied!', - style: ArDriveTypography.body.smallRegular(), + style: typography.paragraphNormal(), ), ), ), diff --git a/lib/components/drive_share_dialog.dart b/lib/components/drive_share_dialog.dart index 2a096f759a..972bee30d2 100644 --- a/lib/components/drive_share_dialog.dart +++ b/lib/components/drive_share_dialog.dart @@ -46,83 +46,76 @@ class DriveShareDialogState extends State { @override Widget build(BuildContext context) => BlocBuilder( - builder: (context, state) => ArDriveStandardModal( - width: kLargeDialogWidth, - title: appLocalizationsOf(context).shareDriveWithOthers, - description: state is DriveShareLoadSuccess ? state.drive.name : null, - content: SizedBox( + builder: (context, state) { + final typography = ArDriveTypographyNew.of(context); + + return ArDriveStandardModalNew( width: kLargeDialogWidth, - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (state is DriveShareLoadInProgress) - const Center(child: CircularProgressIndicator()) - else if (state is DriveShareLoadSuccess) ...{ - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - child: ArDriveTextField( - initialValue: state.driveShareLink.toString(), - isEnabled: false, + title: appLocalizationsOf(context).shareDriveWithOthers, + description: + state is DriveShareLoadSuccess ? state.drive.name : null, + content: SizedBox( + width: kLargeDialogWidth, + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (state is DriveShareLoadInProgress) + const Center(child: CircularProgressIndicator()) + else if (state is DriveShareLoadSuccess) ...{ + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: ArDriveTextFieldNew( + initialValue: state.driveShareLink.toString(), + isEnabled: false, + ), ), - ), - const SizedBox(width: 16), - CopyButton( - positionX: 4, - positionY: 40, - copyMessageColor: ArDriveTheme.of(context) - .themeData - .tableTheme - .selectedItemColor, - showCopyText: true, - text: state.driveShareLink.toString(), - child: Text( - appLocalizationsOf(context).copyLink, - style: ArDriveTypography.body - .buttonLargeRegular( - color: ArDriveTheme.of(context) - .themeData - .colors - .themeFgDefault, - ) - .copyWith( - decoration: TextDecoration.underline, - ), + const SizedBox(width: 16), + CopyButton( + positionX: 4, + positionY: 40, + copyMessageColor: ArDriveTheme.of(context) + .themeData + .tableTheme + .selectedItemColor, + showCopyText: true, + text: state.driveShareLink.toString(), + child: Text( + appLocalizationsOf(context).copyLink, + style: typography.paragraphLarge().copyWith( + decoration: TextDecoration.underline, + ), + ), ), - ), - ], - ), - const SizedBox(height: 16), - Text( - state.drive.isPublic - ? appLocalizationsOf(context) - .anyoneCanAccessThisDrivePublic - : appLocalizationsOf(context) - .anyoneCanAccessThisDrivePrivate, - style: ArDriveTypography.body.buttonLargeRegular( - color: ArDriveTheme.of(context) - .themeData - .colors - .themeFgDefault, + ], + ), + const SizedBox(height: 16), + Text( + state.drive.isPublic + ? appLocalizationsOf(context) + .anyoneCanAccessThisDrivePublic + : appLocalizationsOf(context) + .anyoneCanAccessThisDrivePrivate, + style: typography.paragraphLarge(), ), - ), - } else if (state is DriveShareLoadFail) - Text(state.message) - ], + } else if (state is DriveShareLoadFail) + Text(state.message) + ], + ), ), - ), - actions: [ - if (state is DriveShareLoadSuccess) - ModalAction( - action: () { - Navigator.pop(context); - context.read().openRemindMe(); - }, - title: appLocalizationsOf(context).doneEmphasized, - ) - ], - ), + actions: [ + if (state is DriveShareLoadSuccess) + ModalAction( + action: () { + Navigator.pop(context); + context.read().openRemindMe(); + }, + title: appLocalizationsOf(context).doneEmphasized, + ) + ], + ); + }, ); } From 66a507b3da6baf7c74358e52d365094c218cca58 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho <32248947+thiagocarvalhodev@users.noreply.github.com> Date: Wed, 16 Oct 2024 09:11:30 -0300 Subject: [PATCH 2/2] Update drive_share_dialog.dart --- lib/components/drive_share_dialog.dart | 57 +++++++++++++++++--------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/lib/components/drive_share_dialog.dart b/lib/components/drive_share_dialog.dart index 972bee30d2..0472f155f0 100644 --- a/lib/components/drive_share_dialog.dart +++ b/lib/components/drive_share_dialog.dart @@ -66,27 +66,44 @@ class DriveShareDialogState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Expanded( - child: ArDriveTextFieldNew( - initialValue: state.driveShareLink.toString(), - isEnabled: false, - ), - ), - const SizedBox(width: 16), - CopyButton( - positionX: 4, - positionY: 40, - copyMessageColor: ArDriveTheme.of(context) - .themeData - .tableTheme - .selectedItemColor, - showCopyText: true, - text: state.driveShareLink.toString(), - child: Text( - appLocalizationsOf(context).copyLink, - style: typography.paragraphLarge().copyWith( - decoration: TextDecoration.underline, + Flexible( + child: Container( + padding: const EdgeInsets.fromLTRB(20, 14, 20, 14), + decoration: BoxDecoration( + color: ArDriveTheme.of(context) + .themeData + .colorTokens + .inputDisabled, + borderRadius: BorderRadius.circular(6), + border: Border.all( + color: ArDriveTheme.of(context) + .themeData + .colorTokens + .strokeMid, + ), + ), + child: Row( + children: [ + Expanded( + child: Text( + state.driveShareLink.toString(), + style: typography.paragraphNormal( + color: ArDriveTheme.of(context) + .themeData + .colorTokens + .textXLow, + fontWeight: ArFontWeight.semiBold, + ), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + const SizedBox(width: 8), + CopyButton( + text: state.driveShareLink.toString(), ), + ], + ), ), ), ],