Skip to content

Commit

Permalink
Merge pull request #1482 from ardriveapp/PE-4751
Browse files Browse the repository at this point in the history
PE-4751: updates download and manifest icons
  • Loading branch information
thiagocarvalhodev authored Nov 21, 2023
2 parents b1d36fe + fb74ff9 commit eab3308
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 23 deletions.
2 changes: 1 addition & 1 deletion lib/authentication/login/views/login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1835,7 +1835,7 @@ class _DownloadWalletViewState extends State<DownloadWalletView> {
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',
Expand Down
8 changes: 4 additions & 4 deletions lib/components/details_panel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ class _DetailsPanelState extends State<DetailsPanel> {
children: [
Expanded(
child: ArDriveButton(
icon: ArDriveIcons.download(
icon: ArDriveIcons.download2(
color: Colors.white),
onPressed: () {
final file = ARFSFactory()
Expand Down Expand Up @@ -422,7 +422,7 @@ class _DetailsPanelState extends State<DetailsPanel> {
),
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,
Expand Down Expand Up @@ -1078,7 +1078,7 @@ class _DownloadOrPreview extends StatelessWidget {
);
},
tooltip: appLocalizationsOf(context).download,
icon: ArDriveIcons.download(size: 20),
icon: ArDriveIcons.download2(size: 20),
);
}
}
Expand Down Expand Up @@ -1157,7 +1157,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(
Expand Down
2 changes: 1 addition & 1 deletion lib/components/new_button/new_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<ConfigService>().config.enableQuickSyncAuthoring)
ArDriveNewButtonItem(
Expand Down
16 changes: 10 additions & 6 deletions lib/pages/drive_detail/components/drive_explorer_item_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -254,7 +258,7 @@ class _DriveExplorerItemTileTrailingState
},
content: _buildItem(
appLocalizationsOf(context).download,
ArDriveIcons.download(
ArDriveIcons.download2(
size: defaultIconSize,
),
),
Expand Down Expand Up @@ -319,7 +323,7 @@ class _DriveExplorerItemTileTrailingState
},
content: _buildItem(
appLocalizationsOf(context).download,
ArDriveIcons.download(
ArDriveIcons.download2(
size: defaultIconSize,
),
),
Expand Down Expand Up @@ -459,7 +463,7 @@ class EntityActionsMenu extends StatelessWidget {
},
content: _buildItem(
appLocalizationsOf(context).download,
ArDriveIcons.download(
ArDriveIcons.download2(
size: defaultIconSize,
),
),
Expand Down Expand Up @@ -510,7 +514,7 @@ class EntityActionsMenu extends StatelessWidget {
},
content: ArDriveDropdownItemTile(
name: appLocalizationsOf(context).download,
icon: ArDriveIcons.download(
icon: ArDriveIcons.download2(
size: defaultIconSize,
),
)),
Expand Down Expand Up @@ -552,7 +556,7 @@ class EntityActionsMenu extends StatelessWidget {
},
content: ArDriveDropdownItemTile(
name: appLocalizationsOf(context).exportDriveContents,
icon: ArDriveIcons.download(
icon: ArDriveIcons.download2(
size: defaultIconSize,
),
),
Expand Down Expand Up @@ -589,7 +593,7 @@ class EntityActionsMenu extends StatelessWidget {
},
content: _buildItem(
appLocalizationsOf(context).download,
ArDriveIcons.download(
ArDriveIcons.download2(
size: defaultIconSize,
),
),
Expand Down
10 changes: 5 additions & 5 deletions lib/pages/drive_detail/drive_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class _DriveDetailPageState extends State<DriveDetailPage> {
.enableMultipleFileDownload) ...[
ArDriveIconButton(
tooltip: 'Download selected files',
icon: ArDriveIcons.download(),
icon: ArDriveIcons.download2(),
onPressed: () async {
final selectedItems = context
.read<DriveDetailCubit>()
Expand Down Expand Up @@ -315,7 +315,7 @@ class _DriveDetailPageState extends State<DriveDetailPage> {
content: ArDriveDropdownItemTile(
name: appLocalizationsOf(context)
.download,
icon: ArDriveIcons.download(
icon: ArDriveIcons.download2(
size: defaultIconSize,
),
),
Expand Down Expand Up @@ -363,7 +363,7 @@ class _DriveDetailPageState extends State<DriveDetailPage> {
content: ArDriveDropdownItemTile(
name: appLocalizationsOf(context)
.exportDriveContents,
icon: ArDriveIcons.download(
icon: ArDriveIcons.download2(
size: defaultIconSize,
),
),
Expand Down Expand Up @@ -813,7 +813,7 @@ class MobileFolderNavigation extends StatelessWidget {
},
content: ArDriveDropdownItemTile(
name: appLocalizationsOf(context).download,
icon: ArDriveIcons.download(
icon: ArDriveIcons.download2(
size: defaultIconSize,
),
)),
Expand Down Expand Up @@ -856,7 +856,7 @@ class MobileFolderNavigation extends StatelessWidget {
},
content: _buildItem(
appLocalizationsOf(context).exportDriveContents,
ArDriveIcons.download(
ArDriveIcons.download2(
size: defaultIconSize,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/shared_file/shared_file_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 9 additions & 1 deletion lib/utils/file_type_helper.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class FileTypeHelper {
abstract class FileTypeHelper {
static const List<String> _imageTypes = ['image/'];
static const List<String> _audioTypes = ['audio/'];
static const List<String> _videoTypes = ['video/'];
Expand Down Expand Up @@ -36,6 +36,10 @@ class FileTypeHelper {
'application/x-rar-compressed'
];

static const List<String> _manifestTypes = [
'application/x.arweave-manifest+json',
];

static bool isImage(String contentType) {
return _imageTypes.any((type) => contentType.startsWith(type));
}
Expand All @@ -59,4 +63,8 @@ class FileTypeHelper {
static bool isZip(String contentType) {
return _zipTypes.contains(contentType);
}

static bool isManifest(String contentType) {
return _manifestTypes.contains(contentType);
}
}
6 changes: 3 additions & 3 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,16 @@ packages:
description:
path: "."
ref: PE-4923
resolved-ref: "51ad6b3c3c0f1912857427ce9e37561def3ea62f"
resolved-ref: bd97a88d2aa356af75296727bb8883a9efd2b0f6
url: "https://github.com/ar-io/ardrive_io.git"
source: git
version: "1.4.1"
ardrive_ui:
dependency: "direct main"
description:
path: "."
ref: PE-4923
resolved-ref: "038ae64470e5e92e4c4b88aed5f4ee02d90340a8"
ref: PE-4751-update-icons
resolved-ref: "0865c5e6eee75050a133b5bf659b831a43b5209f"
url: "https://github.com/ar-io/ardrive_ui.git"
source: git
version: "1.14.0"
Expand Down
6 changes: 5 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies:
ardrive_ui:
git:
url: https://github.com/ar-io/ardrive_ui.git
ref: PE-4923
ref: PE-4751-update-icons
ardrive_utils:
path: ./packages/ardrive_utils
ardrive_uploader:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit eab3308

Please sign in to comment.