From acb6ef4443b1f07eb37202926dfe34f60ceb34f6 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Thu, 18 Apr 2024 14:42:49 -0300 Subject: [PATCH 1/2] Update drive_detail_page.dart add create snapshot to drive options on desktop and mobile --- lib/pages/drive_detail/drive_detail_page.dart | 49 ++++++++++++++++++- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/lib/pages/drive_detail/drive_detail_page.dart b/lib/pages/drive_detail/drive_detail_page.dart index aa7112f2d4..977b3d9f40 100644 --- a/lib/pages/drive_detail/drive_detail_page.dart +++ b/lib/pages/drive_detail/drive_detail_page.dart @@ -11,6 +11,7 @@ import 'package:ardrive/blocs/prompt_to_snapshot/prompt_to_snapshot_state.dart'; import 'package:ardrive/components/app_bottom_bar.dart'; import 'package:ardrive/components/app_top_bar.dart'; import 'package:ardrive/components/components.dart'; +import 'package:ardrive/components/create_snapshot_dialog.dart'; import 'package:ardrive/components/csv_export_dialog.dart'; import 'package:ardrive/components/details_panel.dart'; import 'package:ardrive/components/drive_detach_dialog.dart'; @@ -411,7 +412,7 @@ class _DriveDetailPageState extends State { ), ), ), - if (isDriveOwner) + if (isDriveOwner) ...[ ArDriveDropdownItem( onClick: () { promptToRenameDrive( @@ -430,6 +431,38 @@ class _DriveDetailPageState extends State { ), ), ), + ArDriveDropdownItem( + onClick: () { + promptToRenameDrive( + context, + driveId: driveDetailState + .currentDrive.id, + driveName: driveDetailState + .currentDrive.name, + ); + }, + content: _buildItem( + appLocalizationsOf(context) + .renameDrive, + ArDriveIcons.edit( + size: defaultIconSize, + ), + ), + ), + ], + ArDriveDropdownItem( + onClick: () { + promptToCreateSnapshot(context, + driveDetailState.currentDrive); + }, + content: _buildItem( + appLocalizationsOf(context) + .createSnapshot, + ArDriveIcons.iconCreateSnapshot( + size: defaultIconSize, + ), + ), + ), ArDriveDropdownItem( onClick: () { promptToShareDrive( @@ -991,7 +1024,7 @@ class MobileFolderNavigation extends StatelessWidget { size: defaultIconSize, ), )), - if (isOwner) + if (isOwner) ...[ ArDriveDropdownItem( onClick: () { promptToRenameDrive( @@ -1007,6 +1040,18 @@ class MobileFolderNavigation extends StatelessWidget { ), ), ), + ArDriveDropdownItem( + onClick: () { + promptToCreateSnapshot(context, state.currentDrive); + }, + content: _buildItem( + appLocalizationsOf(context).createSnapshot, + ArDriveIcons.iconCreateSnapshot( + size: defaultIconSize, + ), + ), + ), + ], ArDriveDropdownItem( onClick: () { promptToShareDrive( From 1838a90538ca981203e0b98e5c157fc62cbd966c Mon Sep 17 00:00:00 2001 From: Thiago Carvalho <32248947+thiagocarvalhodev@users.noreply.github.com> Date: Tue, 2 Jul 2024 10:50:55 -0300 Subject: [PATCH 2/2] Update drive_detail_page.dart --- lib/pages/drive_detail/drive_detail_page.dart | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/lib/pages/drive_detail/drive_detail_page.dart b/lib/pages/drive_detail/drive_detail_page.dart index 977b3d9f40..06ec7540ad 100644 --- a/lib/pages/drive_detail/drive_detail_page.dart +++ b/lib/pages/drive_detail/drive_detail_page.dart @@ -413,24 +413,6 @@ class _DriveDetailPageState extends State { ), ), if (isDriveOwner) ...[ - ArDriveDropdownItem( - onClick: () { - promptToRenameDrive( - context, - driveId: driveDetailState - .currentDrive.id, - driveName: driveDetailState - .currentDrive.name, - ); - }, - content: ArDriveDropdownItemTile( - name: appLocalizationsOf(context) - .renameDrive, - icon: ArDriveIcons.edit( - size: defaultIconSize, - ), - ), - ), ArDriveDropdownItem( onClick: () { promptToRenameDrive(