From fa34520e2b3df255cea3840747334e1d3d016031 Mon Sep 17 00:00:00 2001 From: Mati Date: Tue, 14 Nov 2023 18:36:11 -0300 Subject: [PATCH 1/2] feat(icons): updates download and manifest icons PE-4751 --- lib/authentication/login/views/login_page.dart | 2 +- lib/components/details_panel.dart | 8 ++++---- lib/components/new_button/new_button.dart | 2 +- .../components/drive_explorer_item_tile.dart | 16 ++++++++++------ lib/pages/drive_detail/drive_detail_page.dart | 10 +++++----- lib/pages/shared_file/shared_file_page.dart | 2 +- lib/utils/file_type_helper.dart | 10 +++++++++- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 9 files changed, 34 insertions(+), 22 deletions(-) diff --git a/lib/authentication/login/views/login_page.dart b/lib/authentication/login/views/login_page.dart index f9b74975b9..7f8e222c18 100644 --- a/lib/authentication/login/views/login_page.dart +++ b/lib/authentication/login/views/login_page.dart @@ -1835,7 +1835,7 @@ class _DownloadWalletViewState extends State { padding: const EdgeInsets.all(44), child: Column( children: [ - ArDriveIcons.download(size: 40), + ArDriveIcons.download2(size: 40), const SizedBox(height: 4), // TODO: create/update localization key Text('Download Keyfile', diff --git a/lib/components/details_panel.dart b/lib/components/details_panel.dart index 74e0e5cb78..b53eb20f1e 100644 --- a/lib/components/details_panel.dart +++ b/lib/components/details_panel.dart @@ -327,7 +327,7 @@ class _DetailsPanelState extends State { children: [ Expanded( child: ArDriveButton( - icon: ArDriveIcons.download( + icon: ArDriveIcons.download2( color: Colors.white), onPressed: () { final file = ARFSFactory() @@ -416,7 +416,7 @@ class _DetailsPanelState extends State { ), const SizedBox(height: 24), ArDriveButton( - icon: ArDriveIcons.download(color: Colors.white), + icon: ArDriveIcons.download2(color: Colors.white), onPressed: () { final file = ARFSFactory().getARFSFileFromFileRevision( widget.revisions!.last, @@ -1071,7 +1071,7 @@ class _DownloadOrPreview extends StatelessWidget { ); }, tooltip: appLocalizationsOf(context).download, - icon: ArDriveIcons.download(size: 20), + icon: ArDriveIcons.download2(size: 20), ); } } @@ -1150,7 +1150,7 @@ class DetailsPanelToolbar extends StatelessWidget { ), _buildActionIcon( tooltip: appLocalizationsOf(context).download, - icon: ArDriveIcons.download(size: defaultIconSize), + icon: ArDriveIcons.download2(size: defaultIconSize), onTap: () { if (item is FileDataTableItem) { promptToDownloadProfileFile( diff --git a/lib/components/new_button/new_button.dart b/lib/components/new_button/new_button.dart index cd2475c810..e9582701cb 100644 --- a/lib/components/new_button/new_button.dart +++ b/lib/components/new_button/new_button.dart @@ -316,7 +316,7 @@ class NewButton extends StatelessWidget { driveDetailState.driveIsEmpty || !canUpload, name: appLocalizations.createManifest, - icon: ArDriveIcons.tournament(size: defaultIconSize), + icon: ArDriveIcons.manifest(size: defaultIconSize), ), if (context.read().config.enableQuickSyncAuthoring) ArDriveNewButtonItem( diff --git a/lib/pages/drive_detail/components/drive_explorer_item_tile.dart b/lib/pages/drive_detail/components/drive_explorer_item_tile.dart index bdd9908ce7..a7ede0094b 100644 --- a/lib/pages/drive_detail/components/drive_explorer_item_tile.dart +++ b/lib/pages/drive_detail/components/drive_explorer_item_tile.dart @@ -141,6 +141,10 @@ ArDriveIcon getIconForContentType(String contentType, {double size = 18}) { return ArDriveIcons.fileOutlined( size: size, ); + } else if (FileTypeHelper.isManifest(contentType)) { + return ArDriveIcons.manifest( + size: size, + ); } else { return ArDriveIcons.fileOutlined( size: size, @@ -254,7 +258,7 @@ class _DriveExplorerItemTileTrailingState }, content: _buildItem( appLocalizationsOf(context).download, - ArDriveIcons.download( + ArDriveIcons.download2( size: defaultIconSize, ), ), @@ -319,7 +323,7 @@ class _DriveExplorerItemTileTrailingState }, content: _buildItem( appLocalizationsOf(context).download, - ArDriveIcons.download( + ArDriveIcons.download2( size: defaultIconSize, ), ), @@ -459,7 +463,7 @@ class EntityActionsMenu extends StatelessWidget { }, content: _buildItem( appLocalizationsOf(context).download, - ArDriveIcons.download( + ArDriveIcons.download2( size: defaultIconSize, ), ), @@ -510,7 +514,7 @@ class EntityActionsMenu extends StatelessWidget { }, content: ArDriveDropdownItemTile( name: appLocalizationsOf(context).download, - icon: ArDriveIcons.download( + icon: ArDriveIcons.download2( size: defaultIconSize, ), )), @@ -552,7 +556,7 @@ class EntityActionsMenu extends StatelessWidget { }, content: ArDriveDropdownItemTile( name: appLocalizationsOf(context).exportDriveContents, - icon: ArDriveIcons.download( + icon: ArDriveIcons.download2( size: defaultIconSize, ), ), @@ -589,7 +593,7 @@ class EntityActionsMenu extends StatelessWidget { }, content: _buildItem( appLocalizationsOf(context).download, - ArDriveIcons.download( + ArDriveIcons.download2( size: defaultIconSize, ), ), diff --git a/lib/pages/drive_detail/drive_detail_page.dart b/lib/pages/drive_detail/drive_detail_page.dart index 4a75464133..2bb889610a 100644 --- a/lib/pages/drive_detail/drive_detail_page.dart +++ b/lib/pages/drive_detail/drive_detail_page.dart @@ -246,7 +246,7 @@ class _DriveDetailPageState extends State { .enableMultipleFileDownload) ...[ ArDriveIconButton( tooltip: 'Download selected files', - icon: ArDriveIcons.download(), + icon: ArDriveIcons.download2(), onPressed: () async { final selectedItems = context .read() @@ -312,7 +312,7 @@ class _DriveDetailPageState extends State { content: ArDriveDropdownItemTile( name: appLocalizationsOf(context) .download, - icon: ArDriveIcons.download( + icon: ArDriveIcons.download2( size: defaultIconSize, ), ), @@ -360,7 +360,7 @@ class _DriveDetailPageState extends State { content: ArDriveDropdownItemTile( name: appLocalizationsOf(context) .exportDriveContents, - icon: ArDriveIcons.download( + icon: ArDriveIcons.download2( size: defaultIconSize, ), ), @@ -810,7 +810,7 @@ class MobileFolderNavigation extends StatelessWidget { }, content: ArDriveDropdownItemTile( name: appLocalizationsOf(context).download, - icon: ArDriveIcons.download( + icon: ArDriveIcons.download2( size: defaultIconSize, ), )), @@ -853,7 +853,7 @@ class MobileFolderNavigation extends StatelessWidget { }, content: _buildItem( appLocalizationsOf(context).exportDriveContents, - ArDriveIcons.download( + ArDriveIcons.download2( size: defaultIconSize, ), ), diff --git a/lib/pages/shared_file/shared_file_page.dart b/lib/pages/shared_file/shared_file_page.dart index 56019617bd..bd110ccc11 100644 --- a/lib/pages/shared_file/shared_file_page.dart +++ b/lib/pages/shared_file/shared_file_page.dart @@ -193,7 +193,7 @@ class SharedFilePage extends StatelessWidget { ), const SizedBox(height: 24), ArDriveButton( - icon: ArDriveIcons.download(color: Colors.white), + icon: ArDriveIcons.download2(color: Colors.white), onPressed: () { final file = ARFSFactory().getARFSFileFromFileRevision( state.fileRevisions.first, diff --git a/lib/utils/file_type_helper.dart b/lib/utils/file_type_helper.dart index 2875a73492..ed42d24301 100644 --- a/lib/utils/file_type_helper.dart +++ b/lib/utils/file_type_helper.dart @@ -1,4 +1,4 @@ -class FileTypeHelper { +abstract class FileTypeHelper { static const List _imageTypes = ['image/']; static const List _audioTypes = ['audio/']; static const List _videoTypes = ['video/']; @@ -36,6 +36,10 @@ class FileTypeHelper { 'application/x-rar-compressed' ]; + static const List _manifestTypes = [ + 'application/x.arweave-manifest+json', + ]; + static bool isImage(String contentType) { return _imageTypes.any((type) => contentType.startsWith(type)); } @@ -59,4 +63,8 @@ class FileTypeHelper { static bool isZip(String contentType) { return _zipTypes.contains(contentType); } + + static bool isManifest(String contentType) { + return _manifestTypes.contains(contentType); + } } diff --git a/pubspec.lock b/pubspec.lock index c033fa389e..899a03907b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -93,8 +93,8 @@ packages: dependency: "direct main" description: path: "." - ref: "v1.14.0" - resolved-ref: f2c75067ebb214200e507e269bddbfd7285720ab + ref: PE-4751-update-icons + resolved-ref: c36f699e0ba5aa02e88a129236885099d62e5e76 url: "https://github.com/ar-io/ardrive_ui.git" source: git version: "1.14.0" diff --git a/pubspec.yaml b/pubspec.yaml index d8cb8546f9..1339ecb246 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -39,7 +39,7 @@ dependencies: ardrive_ui: git: url: https://github.com/ar-io/ardrive_ui.git - ref: v1.14.0 + ref: PE-4751-update-icons ardrive_utils: path: ./packages/ardrive_utils ardrive_uploader: From cb4b1deb83e758fb52a1afc9a1053d81c4bc8232 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Mon, 20 Nov 2023 11:12:22 -0300 Subject: [PATCH 2/2] fix(wrong icons): use fixed version of ardrive_ui --- pubspec.lock | 6 +++--- pubspec.yaml | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 899a03907b..f06e0f813b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -84,8 +84,8 @@ packages: dependency: "direct main" description: path: "." - ref: "v1.4.1" - resolved-ref: "441c37764a1b120057ec2cd1e6eecb47bb35a37a" + ref: PE-4923 + resolved-ref: bd97a88d2aa356af75296727bb8883a9efd2b0f6 url: "https://github.com/ar-io/ardrive_io.git" source: git version: "1.4.1" @@ -94,7 +94,7 @@ packages: description: path: "." ref: PE-4751-update-icons - resolved-ref: c36f699e0ba5aa02e88a129236885099d62e5e76 + resolved-ref: "0865c5e6eee75050a133b5bf659b831a43b5209f" url: "https://github.com/ar-io/ardrive_ui.git" source: git version: "1.14.0" diff --git a/pubspec.yaml b/pubspec.yaml index 1339ecb246..8ea5a50107 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: Secure, permanent storage publish_to: 'none' -version: 2.24.1 +version: 2.24.0 environment: sdk: '>=3.0.2 <4.0.0' @@ -35,7 +35,7 @@ dependencies: ardrive_io: git: url: https://github.com/ar-io/ardrive_io.git - ref: v1.4.1 + ref: PE-4923 ardrive_ui: git: url: https://github.com/ar-io/ardrive_ui.git @@ -142,6 +142,10 @@ dependency_overrides: path: packages/stripe_platform_interface ref: main http: ^1.1.0 + ardrive_io: + git: + url: https://github.com/ar-io/ardrive_io.git + ref: PE-4923 dev_dependencies: integration_test: