From f3a6adfd9ab0cb480bb76056e3d3b1eca76fc37c Mon Sep 17 00:00:00 2001 From: Thiago Carvalho <32248947+thiagocarvalhodev@users.noreply.github.com> Date: Thu, 26 Sep 2024 10:47:33 -0300 Subject: [PATCH 1/6] feat(upload modal) - use new icons on checkbox - use new icons on license and change its style, also adds a question icon with a tooltip instead of a text link - changes the upload payment method selector (only applies to the upload flow) - FIXES: - the modal actions now have the correct title when checking the arns checkbox - arns checkbox now maintain its state --- .../view/upload_payment_method_view.dart | 3 + lib/blocs/upload/upload_cubit.dart | 9 +- lib/blocs/upload/upload_state.dart | 5 + .../license/learn_about_licensing.dart | 27 - .../payment_method_selector_widget.dart | 215 ++++++-- lib/components/upload_form.dart | 495 ++++++++++-------- .../ardrive_ui/assets/fonts/ArDriveIcons.ttf | Bin 22760 -> 25472 bytes packages/ardrive_ui/assets/fonts/config.json | 126 +++++ .../ardrive_ui/lib/src/components/card.dart | 2 +- .../lib/src/components/check_box.dart | 113 ++-- .../lib/src/components/click_area.dart | 3 +- .../ardrive_ui/lib/src/components/modal.dart | 8 +- .../styles/icons/ar_drive_icons_icons.dart | 22 +- .../lib/src/styles/icons/icons.dart | 48 ++ 14 files changed, 741 insertions(+), 335 deletions(-) delete mode 100644 lib/components/license/learn_about_licensing.dart diff --git a/lib/blocs/upload/payment_method/view/upload_payment_method_view.dart b/lib/blocs/upload/payment_method/view/upload_payment_method_view.dart index 2be1dfe339..fc757e1d50 100644 --- a/lib/blocs/upload/payment_method/view/upload_payment_method_view.dart +++ b/lib/blocs/upload/payment_method/view/upload_payment_method_view.dart @@ -14,6 +14,7 @@ class UploadPaymentMethodView extends StatelessWidget { this.onTurboTopupSucess, this.loadingIndicator, this.useNewArDriveUI = false, + this.useDropdown = false, }); final Function(UploadMethod, UploadPaymentMethodInfo, bool) @@ -22,6 +23,7 @@ class UploadPaymentMethodView extends StatelessWidget { final Function()? onTurboTopupSucess; final Widget? loadingIndicator; final bool useNewArDriveUI; + final bool useDropdown; @override Widget build(BuildContext context) { @@ -44,6 +46,7 @@ class UploadPaymentMethodView extends StatelessWidget { return PaymentMethodSelector( useNewArDriveUI: useNewArDriveUI, uploadMethodInfo: state.paymentMethodInfo, + useDropdown: useDropdown, onArSelect: () { context.read().add( const ChangeUploadPaymentMethod( diff --git a/lib/blocs/upload/upload_cubit.dart b/lib/blocs/upload/upload_cubit.dart index 3fb4dc549c..5e5a450203 100644 --- a/lib/blocs/upload/upload_cubit.dart +++ b/lib/blocs/upload/upload_cubit.dart @@ -159,8 +159,6 @@ class UploadCubit extends Cubit { _selectedAntRecord = antRecord; _selectedUndername = undername; - logger.d('Selected undername: $_selectedUndername'); - final readyState = (state as UploadReady).copyWith( params: (state as UploadReady).params.copyWith( arnsUnderName: _getSelectedUndername(), @@ -172,6 +170,11 @@ class UploadCubit extends Cubit { void changeShowArnsNameSelection(bool showArnsNameSelection) { _showArnsNameSelectionCheckBoxValue = showArnsNameSelection; + + if (state is UploadReady) { + final readyState = state as UploadReady; + emit(readyState.copyWith(arnsCheckboxChecked: showArnsNameSelection)); + } } void showArnsNameSelection(UploadReady readyState) { @@ -241,6 +244,7 @@ class UploadCubit extends Cubit { showArnsCheckbox: showArnsCheckbox, showArnsNameSelection: false, loadingArNSNames: true, + arnsCheckboxChecked: _showArnsNameSelectionCheckBoxValue, ), ); @@ -277,6 +281,7 @@ class UploadCubit extends Cubit { isArConnect: (state as UploadReadyToPrepare).isArConnect, showArnsCheckbox: showArnsCheckbox, showArnsNameSelection: false, + arnsCheckboxChecked: _showArnsNameSelectionCheckBoxValue, ), ); } diff --git a/lib/blocs/upload/upload_state.dart b/lib/blocs/upload/upload_state.dart index 9012ad98be..e1c8027a2f 100644 --- a/lib/blocs/upload/upload_state.dart +++ b/lib/blocs/upload/upload_state.dart @@ -105,6 +105,7 @@ class UploadReady extends UploadState { final bool showArnsNameSelection; final bool loadingArNSNames; final bool loadingArNSNamesError; + final bool arnsCheckboxChecked; final bool isArConnect; @@ -120,6 +121,7 @@ class UploadReady extends UploadState { required this.showArnsNameSelection, this.loadingArNSNames = false, this.loadingArNSNamesError = false, + required this.arnsCheckboxChecked, }); // copyWith @@ -137,6 +139,7 @@ class UploadReady extends UploadState { bool? showArnsNameSelection, bool? loadingArNSNames, bool? loadingArNSNamesError, + bool? arnsCheckboxChecked, }) { return UploadReady( loadingArNSNames: loadingArNSNames ?? this.loadingArNSNames, @@ -152,6 +155,7 @@ class UploadReady extends UploadState { showArnsNameSelection ?? this.showArnsNameSelection, loadingArNSNamesError: loadingArNSNamesError ?? this.loadingArNSNamesError, + arnsCheckboxChecked: arnsCheckboxChecked ?? this.arnsCheckboxChecked, ); } @@ -163,6 +167,7 @@ class UploadReady extends UploadState { loadingArNSNamesError, loadingArNSNames, showArnsCheckbox, + arnsCheckboxChecked, ]; @override diff --git a/lib/components/license/learn_about_licensing.dart b/lib/components/license/learn_about_licensing.dart deleted file mode 100644 index 493a7a9bc5..0000000000 --- a/lib/components/license/learn_about_licensing.dart +++ /dev/null @@ -1,27 +0,0 @@ -import 'package:ardrive/misc/resources.dart'; -import 'package:ardrive/utils/open_url.dart'; -import 'package:ardrive_ui/ardrive_ui.dart'; -import 'package:flutter/material.dart'; - -class LearnAboutLicensing extends StatelessWidget { - const LearnAboutLicensing({super.key}); - - @override - Widget build(BuildContext context) { - return ArDriveClickArea( - child: GestureDetector( - onTap: () { - openUrl( - url: Resources.licenseHelpLink, - ); - }, - child: Text( - 'Learn More about Licensing', - style: ArDriveTypography.body - .buttonNormalRegular() - .copyWith(decoration: TextDecoration.underline), - ), - ), - ); - } -} diff --git a/lib/components/payment_method_selector_widget.dart b/lib/components/payment_method_selector_widget.dart index 86af6409cd..2edc2a7f8f 100644 --- a/lib/components/payment_method_selector_widget.dart +++ b/lib/components/payment_method_selector_widget.dart @@ -5,12 +5,13 @@ import 'package:ardrive_ui/ardrive_ui.dart'; import 'package:arweave/utils.dart'; import 'package:flutter/material.dart'; -class PaymentMethodSelector extends StatelessWidget { +class PaymentMethodSelector extends StatefulWidget { final UploadPaymentMethodInfo uploadMethodInfo; final void Function() onTurboTopupSucess; final void Function() onArSelect; final void Function() onTurboSelect; final bool useNewArDriveUI; + final bool useDropdown; const PaymentMethodSelector({ super.key, @@ -19,21 +20,168 @@ class PaymentMethodSelector extends StatelessWidget { required this.onArSelect, required this.onTurboSelect, this.useNewArDriveUI = false, + this.useDropdown = false, }); + @override + State createState() => _PaymentMethodSelectorState(); +} + +class _PaymentMethodSelectorState extends State { + late UploadMethod _selectedMethod; + + @override + void initState() { + super.initState(); + _selectedMethod = widget.uploadMethodInfo.uploadMethod; + } + @override Widget build(context) { return Column( children: [ - if (!uploadMethodInfo.isFreeThanksToTurbo) ...[ - _buildContent(context), - const SizedBox(height: 16), - _getInsufficientBalanceMessage(context: context), - ], + if (widget.useDropdown) _buildDropdown(context), + if (!widget.useDropdown) _buildContent(context), + _getInsufficientBalanceMessage(context: context), ], ); } + Widget _buildDropdown(BuildContext context) { + return ArDriveDropdown( + height: 45, + maxHeight: 90, + hasBorder: false, + hasDivider: false, + anchor: const Aligned( + follower: Alignment.centerRight, + target: Alignment.bottomRight, + offset: Offset(0, 10), + ), + items: [ + _buildDropdownItem(context, UploadMethod.ar), + _buildDropdownItem(context, UploadMethod.turbo), + ], + child: ArDriveClickArea( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + children: [ + _buildCoinIcon(), + const SizedBox(width: 16), + _buildSelectedItem(context), + ], + ), + ArDriveIcons.chevronDown(), + ], + ), + ), + ); + } + + ArDriveIcon _buildCoinIcon() { + if (_selectedMethod == UploadMethod.ar) { + return ArDriveIcons.arweaveCoin(); + } else { + return ArDriveIcons.turboCoin( + size: 28, + ); + } + } + + ArDriveDropdownItem _buildDropdownItem( + BuildContext context, UploadMethod method) { + final typography = ArDriveTypographyNew.of(context); + + String text; + + if (method == UploadMethod.ar) { + text = 'Wallet Balance'; + } else { + text = 'Turbo Balance'; + } + + return ArDriveDropdownItem( + content: SizedBox( + width: 164, + height: 45, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + text, + style: typography.paragraphLarge( + fontWeight: ArFontWeight.semiBold, + ), + ), + if (_selectedMethod == method) + ArDriveIcons.checkmark( + size: 16, + ) + ], + ), + ), + ), + onClick: () { + setState(() { + _selectedMethod = method; + if (method == UploadMethod.ar) { + widget.onArSelect(); + } else { + widget.onTurboSelect(); + } + }); + }, + ); + } + + Widget _buildSelectedItem(BuildContext context) { + final typography = ArDriveTypographyNew.of(context); + final colorTokens = ArDriveTheme.of(context).themeData.colorTokens; + + if (_selectedMethod == UploadMethod.ar) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Cost: ${winstonToAr(widget.uploadMethodInfo.costEstimateAr.totalCost)} AR', + style: typography.paragraphLarge( + fontWeight: ArFontWeight.semiBold, + ), + ), + Text( + 'Payment Method: Wallet Balance: ${widget.uploadMethodInfo.arBalance} AR', + style: typography.paragraphSmall( + color: colorTokens.textLow, + ), + ), + ], + ); + } else { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Cost: ${winstonToAr(widget.uploadMethodInfo.costEstimateTurbo!.totalCost)} Credits', + style: typography.paragraphLarge( + fontWeight: ArFontWeight.semiBold, + ), + ), + Text( + 'Payment Method: Turbo Credits: ${widget.uploadMethodInfo.turboCredits} Credits', + style: typography.paragraphSmall( + color: colorTokens.textLow, + ), + ), + ], + ); + } + } + Widget _buildContent(BuildContext context) { final typography = ArDriveTypographyNew.of(context); final colorTokens = ArDriveTheme.of(context).themeData.colorTokens; @@ -53,13 +201,13 @@ class PaymentMethodSelector extends StatelessWidget { switch (index) { case 0: if (value) { - onArSelect(); + widget.onArSelect(); } break; case 1: if (value) { - onTurboSelect(); + widget.onTurboSelect(); } break; } @@ -67,34 +215,35 @@ class PaymentMethodSelector extends StatelessWidget { options: [ // FIXME: rename to RadioButtonOption RadioButtonOptions( - value: uploadMethodInfo.uploadMethod == UploadMethod.ar, + value: widget.uploadMethodInfo.uploadMethod == UploadMethod.ar, // TODO: Localization text: - 'Cost: ${winstonToAr(uploadMethodInfo.costEstimateAr.totalCost)} AR', - textStyle: useNewArDriveUI + 'Cost: ${winstonToAr(widget.uploadMethodInfo.costEstimateAr.totalCost)} AR', + textStyle: widget.useNewArDriveUI ? typography.paragraphLarge( fontWeight: ArFontWeight.bold, ) : ArDriveTypography.body.buttonLargeBold(), ), - if (uploadMethodInfo.costEstimateTurbo != null && - uploadMethodInfo.isTurboUploadPossible) + if (widget.uploadMethodInfo.costEstimateTurbo != null && + widget.uploadMethodInfo.isTurboUploadPossible) RadioButtonOptions( - value: uploadMethodInfo.uploadMethod == UploadMethod.turbo, + value: + widget.uploadMethodInfo.uploadMethod == UploadMethod.turbo, // TODO: Localization - text: uploadMethodInfo.hasNoTurboBalance + text: widget.uploadMethodInfo.hasNoTurboBalance ? '' - : 'Cost: ${winstonToAr(uploadMethodInfo.costEstimateTurbo!.totalCost)} Credits', - textStyle: useNewArDriveUI + : 'Cost: ${winstonToAr(widget.uploadMethodInfo.costEstimateTurbo!.totalCost)} Credits', + textStyle: widget.useNewArDriveUI ? typography.paragraphLarge( color: colorTokens.textHigh, fontWeight: ArFontWeight.bold) : ArDriveTypography.body.buttonLargeBold(), - content: uploadMethodInfo.hasNoTurboBalance + content: widget.uploadMethodInfo.hasNoTurboBalance ? GestureDetector( onTap: () { showTurboTopupModal(context, onSuccess: () { - onTurboTopupSucess(); + widget.onTurboTopupSucess(); }); }, child: ArDriveClickArea( @@ -104,7 +253,7 @@ class PaymentMethodSelector extends StatelessWidget { // TODO: use text with multiple styles TextSpan( text: 'Use Turbo Credits', // TODO: localize - style: useNewArDriveUI + style: widget.useNewArDriveUI ? typography.paragraphLarge( color: colorTokens.textMid, fontWeight: ArFontWeight.bold, @@ -119,7 +268,7 @@ class PaymentMethodSelector extends StatelessWidget { TextSpan( text: ' for faster uploads.', // TODO: localize - style: useNewArDriveUI + style: widget.useNewArDriveUI ? typography.paragraphLarge( color: colorTokens.textMid, fontWeight: ArFontWeight.bold, @@ -149,9 +298,9 @@ class PaymentMethodSelector extends StatelessWidget { child: Text( index == 0 // TODO: localize - ? 'Wallet Balance: ${uploadMethodInfo.arBalance} AR' - : 'Turbo Balance: ${uploadMethodInfo.turboCredits} Credits', - style: useNewArDriveUI + ? 'Wallet Balance: ${widget.uploadMethodInfo.arBalance} AR' + : 'Turbo Balance: ${widget.uploadMethodInfo.turboCredits} Credits', + style: widget.useNewArDriveUI ? typography.paragraphNormal( color: colorTokens.textLow, fontWeight: ArFontWeight.semiBold, @@ -174,13 +323,13 @@ class PaymentMethodSelector extends StatelessWidget { Widget _getInsufficientBalanceMessage({ required BuildContext context, }) { - if (uploadMethodInfo.uploadMethod == UploadMethod.turbo && - !uploadMethodInfo.sufficentCreditsBalance && - uploadMethodInfo.sufficientArBalance) { + if (widget.uploadMethodInfo.uploadMethod == UploadMethod.turbo && + !widget.uploadMethodInfo.sufficentCreditsBalance && + widget.uploadMethodInfo.sufficientArBalance) { return GestureDetector( onTap: () { showTurboTopupModal(context, onSuccess: () { - onTurboTopupSucess(); + widget.onTurboTopupSucess(); }); }, child: ArDriveClickArea( @@ -217,20 +366,20 @@ class PaymentMethodSelector extends StatelessWidget { ), ), ); - } else if (uploadMethodInfo.uploadMethod == UploadMethod.ar && - !uploadMethodInfo.sufficientArBalance) { + } else if (widget.uploadMethodInfo.uploadMethod == UploadMethod.ar && + !widget.uploadMethodInfo.sufficientArBalance) { return Text( 'Insufficient AR balance for purchase.', style: ArDriveTypography.body.captionBold( color: ArDriveTheme.of(context).themeData.colors.themeErrorDefault, ), ); - } else if (!uploadMethodInfo.sufficentCreditsBalance && - !uploadMethodInfo.sufficientArBalance) { + } else if (!widget.uploadMethodInfo.sufficentCreditsBalance && + !widget.uploadMethodInfo.sufficientArBalance) { return GestureDetector( onTap: () { showTurboTopupModal(context, onSuccess: () { - onTurboTopupSucess(); + widget.onTurboTopupSucess(); }); }, child: ArDriveClickArea( diff --git a/lib/components/upload_form.dart b/lib/components/upload_form.dart index 85b0834300..10579d0742 100644 --- a/lib/components/upload_form.dart +++ b/lib/components/upload_form.dart @@ -15,7 +15,6 @@ import 'package:ardrive/blocs/upload/upload_file_checker.dart'; import 'package:ardrive/blocs/upload/upload_handles/file_v2_upload_handle.dart'; import 'package:ardrive/blocs/upload/upload_handles/upload_handle.dart'; import 'package:ardrive/components/license/cc_type_form.dart'; -import 'package:ardrive/components/license/learn_about_licensing.dart'; import 'package:ardrive/components/license/udl_params_form.dart'; import 'package:ardrive/components/license/view_license_definition.dart'; import 'package:ardrive/components/license_details_popover.dart'; @@ -25,6 +24,7 @@ import 'package:ardrive/core/arfs/entities/arfs_entities.dart'; import 'package:ardrive/core/upload/domain/repository/upload_repository.dart'; import 'package:ardrive/core/upload/uploader.dart'; import 'package:ardrive/l11n/validation_messages.dart'; +import 'package:ardrive/misc/resources.dart'; import 'package:ardrive/models/models.dart'; import 'package:ardrive/pages/congestion_warning_wrapper.dart'; import 'package:ardrive/pages/drive_detail/components/hover_widget.dart'; @@ -34,6 +34,7 @@ import 'package:ardrive/theme/theme.dart'; import 'package:ardrive/utils/app_localizations_wrapper.dart'; import 'package:ardrive/utils/filesize.dart'; import 'package:ardrive/utils/logger.dart'; +import 'package:ardrive/utils/open_url.dart'; import 'package:ardrive/utils/plausible_event_tracker/plausible_event_tracker.dart'; import 'package:ardrive/utils/show_general_dialog.dart'; import 'package:ardrive_io/ardrive_io.dart'; @@ -394,7 +395,7 @@ class _StatsScreenState extends State { text: TextSpan( children: [ TextSpan( - text: 'Size: ', + text: 'Total Size: ', style: typography.paragraphNormal( fontWeight: ArFontWeight.semiBold, color: colorTokens.textMid, @@ -415,17 +416,6 @@ class _StatsScreenState extends State { const Divider( height: 20, ), - if (widget.readyState.paymentInfo.isFreeThanksToTurbo) ...[ - const SizedBox(height: 8), - Text( - appLocalizationsOf(context).freeTurboTransaction, - style: typography.paragraphNormal( - color: colorTokens.textMid, - fontWeight: ArFontWeight.bold, - ), - ), - const SizedBox(height: 20), - ], ...widget.children, ], ); @@ -453,21 +443,7 @@ class ConfiguringLicenseScreen extends StatelessWidget { child: ReactiveFormConsumer( builder: (_, form, __) => UploadReadyModalBase( readyState: readyState, - actions: [ - ModalAction( - action: () => { - context.read().configuringLicenseBack(), - }, - title: appLocalizationsOf(context).backEmphasized, - ), - ModalAction( - isEnable: form.valid, - action: () { - context.read().configuringLicenseNext(); - }, - title: appLocalizationsOf(context).nextEmphasized, - ), - ], + actions: getModalActions(context, readyState, form), children: [ Text( headingText, @@ -482,6 +458,36 @@ class ConfiguringLicenseScreen extends StatelessWidget { ), ); } + + List getModalActions( + BuildContext context, UploadReady state, FormGroup form) { + String title; + double? customWidth; + + if (state.arnsCheckboxChecked) { + title = 'Assign Name'; + customWidth = 160; + } else { + title = appLocalizationsOf(context).nextEmphasized; + } + + return [ + ModalAction( + action: () => { + context.read().configuringLicenseBack(), + }, + title: appLocalizationsOf(context).backEmphasized, + ), + ModalAction( + isEnable: form.valid, + customWidth: customWidth, + action: () { + context.read().configuringLicenseNext(); + }, + title: title, + ), + ]; + } } class UploadReadyModalBase extends StatefulWidget { @@ -564,6 +570,8 @@ class LicenseReviewInfo extends StatelessWidget { @override Widget build(BuildContext context) { + final typography = ArDriveTypographyNew.of(context); + return Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.start, @@ -572,8 +580,8 @@ class LicenseReviewInfo extends StatelessWidget { Text( // TODO: Localize 'License', - style: ArDriveTypography.body.smallRegular( - color: ArDriveTheme.of(context).themeData.colors.themeFgSubtle, + style: typography.paragraphLarge( + fontWeight: ArFontWeight.semiBold, ), ), Row( @@ -718,34 +726,13 @@ class _UploadReadyModalState extends State { action: () => Navigator.of(context).pop(false), title: appLocalizationsOf(context).cancelEmphasized, ), - licenseCategory == null - ? ModalAction( - isEnable: state.isNextButtonEnabled, - action: () { - context - .read() - .initialScreenUpload(); - }, - title: - appLocalizationsOf(context).uploadEmphasized, - ) - : ModalAction( - isEnable: state.isNextButtonEnabled, - action: () { - context.read().initialScreenNext( - licenseCategory: licenseCategory, - ); - }, - title: - // TODO: Localize - // appLocalizationsOf(context).configureEmphasized, - 'CONFIGURE', - ), + ...getModalActions(context, state, licenseCategory), ], children: [ RepositoryProvider.value( value: context.read(), child: UploadPaymentMethodView( + useDropdown: true, onError: () { context .read() @@ -1120,8 +1107,6 @@ class _UploadReadyWidget extends StatelessWidget { final DriveDetailCubit driveDetailCubit; @override Widget build(BuildContext context) { - logger.d('UploadReady state: ${state.showArnsNameSelection}'); - if (state.showArnsNameSelection) { return AssignArNSNameModal( driveDetailCubit: driveDetailCubit, @@ -1133,7 +1118,6 @@ class _UploadReadyWidget extends StatelessWidget { }, canClose: false, onEmptySelection: (emptySelection) { - logger.d('Cancelling ARNS name selection'); context.read().cancelArnsNameSelection(); }, ); @@ -1143,196 +1127,215 @@ class _UploadReadyWidget extends StatelessWidget { final colorTokens = ArDriveTheme.of(context).themeData.colorTokens; return ReactiveForm( formGroup: context.watch().licenseCategoryForm, - child: ReactiveFormConsumer(builder: (_, form, __) { - final LicenseCategory? licenseCategory = - form.control('licenseCategory').value; - return StatsScreen( - readyState: state, - // Don't show on first screen? - hasCloseButton: false, - modalActions: [ - ModalAction( - action: () => Navigator.of(context).pop(false), - title: appLocalizationsOf(context).cancelEmphasized, - ), - licenseCategory == null - ? ModalAction( - isEnable: state.isNextButtonEnabled, - action: () { - context.read().initialScreenUpload(); - }, - title: appLocalizationsOf(context).uploadEmphasized, - ) - : ModalAction( - isEnable: state.isNextButtonEnabled, - action: () { - context.read().initialScreenNext( - licenseCategory: licenseCategory, - ); - }, - title: - // TODO: Localize - // appLocalizationsOf(context).configureEmphasized, - 'CONFIGURE', - ), - ], - children: [ - RepositoryProvider.value( - value: context.read(), - child: UploadPaymentMethodView( - onError: () { - context.read().emitErrorFromPreparation(); - }, - onTurboTopupSucess: () { - context.read().startUploadPreparation( - isRetryingToPayWithTurbo: true, - ); - }, - onUploadMethodChanged: (method, info, canUpload) { - context - .read() - .setUploadMethod(method, info, canUpload); - }, - useNewArDriveUI: true, + child: ReactiveFormConsumer( + builder: (_, form, __) { + final LicenseCategory? licenseCategory = + form.control('licenseCategory').value; + return StatsScreen( + readyState: state, + // Don't show on first screen? + hasCloseButton: false, + modalActions: [ + ModalAction( + action: () => Navigator.of(context).pop(false), + title: appLocalizationsOf(context).cancelEmphasized, ), - ), - if (state.params.containsSupportedImageTypeForThumbnailGeneration) - Padding( - padding: const EdgeInsets.symmetric(vertical: 16), - child: Row( - children: [ - ArDriveCheckBox( - title: 'Upload with thumbnails', - checked: - context.read().config.uploadThumbnails, - titleStyle: typography.paragraphLarge( - fontWeight: ArFontWeight.semiBold, + ...getModalActions(context, state, licenseCategory), + ], + children: [ + if (state.params.containsSupportedImageTypeForThumbnailGeneration) + Padding( + padding: const EdgeInsets.only(top: 16), + child: Row( + children: [ + ArDriveCheckBox( + title: 'Upload with thumbnails', + useNewIcons: true, + checked: context + .read() + .config + .uploadThumbnails, + titleStyle: typography.paragraphLarge(), + onChange: (value) { + context + .read() + .changeUploadThumbnailOption(value); + }, ), - onChange: (value) { - context - .read() - .changeUploadThumbnailOption(value); - }, - ), - Padding( - padding: const EdgeInsets.only(left: 8.0), - child: ArDriveIconButton( - icon: ArDriveIcons.info( - color: colorTokens.textMid, + Padding( + padding: const EdgeInsets.only(left: 8.0), + child: ArDriveIconButton( + icon: ArDriveIcons.info( + color: colorTokens.textMid, + ), + tooltip: + 'Uploading with thumbnails is free, but may make your upload take longer.\nYou can always attach a thumbnail later.', ), - tooltip: - 'Uploading with thumbnails is free, but may make your upload take longer.\nYou can always attach a thumbnail later.', - ), - ) - ], + ) + ], + ), ), - ), - if (state.loadingArNSNamesError) - Padding( - padding: const EdgeInsets.symmetric(vertical: 8), - child: Row( - children: [ - Text( - 'Error loading ARNS names', - style: typography.paragraphLarge( - fontWeight: ArFontWeight.semiBold, - color: colorTokens.textRed, + if (state.loadingArNSNamesError) + Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: Row( + children: [ + Text( + 'Error loading ARNS names', + style: typography.paragraphLarge( + fontWeight: ArFontWeight.semiBold, + color: colorTokens.textRed, + ), ), - ), - ], + ], + ), ), - ), - if (state.loadingArNSNames) - Padding( - padding: const EdgeInsets.symmetric(vertical: 8), - child: Row( - children: [ - Text( - 'Loading ArNS names...', - style: typography.paragraphLarge( - fontWeight: ArFontWeight.semiBold, + if (state.loadingArNSNames) + Padding( + padding: const EdgeInsets.only(top: 8), + child: Row( + children: [ + Text( + 'Loading ArNS names...', + style: typography.paragraphLarge( + fontWeight: ArFontWeight.semiBold, + ), ), - ), - const SizedBox(width: 8), - const SizedBox( - height: 16, - width: 16, - child: CircularProgressIndicator( - strokeWidth: 2, + const SizedBox(width: 8), + const SizedBox( + height: 16, + width: 16, + child: CircularProgressIndicator( + strokeWidth: 2, + ), + ) + ], + ), + ), + if (state.showArnsCheckbox && !state.loadingArNSNames) + Padding( + padding: const EdgeInsets.only(top: 8, bottom: 8), + child: Row( + children: [ + ArDriveCheckBox( + title: 'Assign an ARNS name', + checked: state.arnsCheckboxChecked, + useNewIcons: true, + titleStyle: typography.paragraphLarge(), + onChange: (value) { + context + .read() + .changeShowArnsNameSelection(value); + }, ), - ) - ], + ], + ), ), - ), - if (state.showArnsCheckbox && !state.loadingArNSNames) Padding( - padding: const EdgeInsets.symmetric(vertical: 8), - child: Row( + padding: const EdgeInsets.only(top: 8), + child: Column( children: [ - ArDriveCheckBox( - title: 'Assign an ARNS name', - checked: state.params.arnsUnderName != null, - titleStyle: typography.paragraphLarge( - fontWeight: ArFontWeight.semiBold, + Row( + children: [ + ArDriveIcons.license1(), + const SizedBox(width: 8), + Text( + 'License', + style: typography.paragraphLarge( + fontWeight: ArFontWeight.semiBold, + ), + ), + const SizedBox(width: 8), + ArDriveClickArea( + tooltip: 'Learn more about licenses', + child: GestureDetector( + onTap: () { + openUrl(url: Resources.licenseHelpLink); + }, + child: ArDriveIcons.question( + color: colorTokens.textLow, + ), + ), + ), + ], + ), + Padding( + padding: const EdgeInsets.only(left: 32.0), + child: ReactiveForm( + formGroup: + context.watch().licenseCategoryForm, + child: ReactiveDropdownField( + alignment: AlignmentDirectional.centerStart, + isExpanded: true, + formControlName: 'licenseCategory', + decoration: InputDecoration( + labelStyle: typography.paragraphNormal( + fontWeight: ArFontWeight.semiBold, + ), + border: InputBorder.none, + focusedBorder: InputBorder.none, + ), + showErrors: (control) => + control.dirty && control.invalid, + validationMessages: + kValidationMessages(appLocalizationsOf(context)), + items: [null, ...LicenseCategory.values].map( + (value) { + return DropdownMenuItem( + value: value, + child: Text( + licenseCategoryNames[value] ?? 'None', + style: typography.paragraphNormal( + fontWeight: ArFontWeight.semiBold, + color: colorTokens.textMid, + ), + ), + ); + }, + ).toList(), + ), ), - onChange: (value) { - context - .read() - .changeShowArnsNameSelection(value); - }, ), ], ), ), - SizedBox( - child: ReactiveForm( - formGroup: context.watch().licenseCategoryForm, - child: ReactiveDropdownField( - alignment: AlignmentDirectional.centerStart, - isExpanded: true, - formControlName: 'licenseCategory', - decoration: InputDecoration( - border: InputBorder.none, - label: Text( - 'License', - // TODO: Localize - // appLocalizationsOf(context).licenseType, - style: ArDriveTheme.of(context) - .themeData - .textFieldTheme - .inputTextStyle - .copyWith( - color: ArDriveTheme.of(context) - .themeData - .colors - .themeFgDisabled, - fontSize: 16, - ), - ), - focusedBorder: InputBorder.none, + Divider(), + if (state.paymentInfo.isFreeThanksToTurbo) ...[ + const SizedBox(height: 8), + Text( + appLocalizationsOf(context).freeTurboTransaction, + style: typography.paragraphNormal( + color: colorTokens.textMid, + fontWeight: ArFontWeight.bold, ), - showErrors: (control) => control.dirty && control.invalid, - validationMessages: - kValidationMessages(appLocalizationsOf(context)), - items: [null, ...LicenseCategory.values].map( - (value) { - return DropdownMenuItem( - value: value, - child: Text( - licenseCategoryNames[value] ?? 'None', - // TODO: Localize - // appLocalizationsOf(context).none, - ), - ); + ), + const SizedBox(height: 20), + ], + if (!state.paymentInfo.isFreeThanksToTurbo) ...[ + RepositoryProvider.value( + value: context.read(), + child: UploadPaymentMethodView( + onError: () { + context.read().emitErrorFromPreparation(); }, - ).toList(), + onTurboTopupSucess: () { + context.read().startUploadPreparation( + isRetryingToPayWithTurbo: true, + ); + }, + onUploadMethodChanged: (method, info, canUpload) { + context + .read() + .setUploadMethod(method, info, canUpload); + }, + useNewArDriveUI: true, + ), ), - ), - ), - const LearnAboutLicensing(), - ], - ); - }), + ], + ], + ); + }, + ), ); } } @@ -2074,3 +2077,41 @@ class _UploadLoadingFilesSuccessWidget extends StatelessWidget { ); } } + +List getModalActions( + BuildContext context, UploadReady state, LicenseCategory? licenseCategory) { + if (licenseCategory != null) { + return [ + ModalAction( + isEnable: state.isNextButtonEnabled, + action: () { + context.read().initialScreenNext( + licenseCategory: licenseCategory, + ); + }, + title: 'CONFIGURE', + ), + ]; + } else if (state.arnsCheckboxChecked) { + return [ + ModalAction( + isEnable: state.isNextButtonEnabled, + customWidth: 160, + action: () { + context.read().initialScreenUpload(); + }, + title: 'ASSIGN NAME', + ), + ]; + } + + return [ + ModalAction( + isEnable: state.isNextButtonEnabled, + action: () { + context.read().initialScreenUpload(); + }, + title: appLocalizationsOf(context).uploadEmphasized, + ), + ]; +} diff --git a/packages/ardrive_ui/assets/fonts/ArDriveIcons.ttf b/packages/ardrive_ui/assets/fonts/ArDriveIcons.ttf index bfe8e9f76e2eaeb4145bc57d1ccdadb8735b4a91..0a4ca5951db7bb3f424908a5ee430030a5b8a90b 100644 GIT binary patch delta 3018 zcmbtWYit}>6~5=*dF;;4&hFT=J6>n~*jev5wzKb-6MOAOaS|t1sl9d_I}S}Y_8L3& zBeL^Ct-6umCu$1@sYFP$AR)B@5o(G+3Kil9l`0Bt1X3h~0Kt#t7p-U!sz}Vavre0o z{6U@BGjs2`_kQOw=YDtVKZ0v-!V9U|$ersi6T(Ibk;-3K`QoB~dGshD$~YktUtX$K z7J7yfPZ2`?j8a%ag*?P=VEYzI*V5|6t8)xn1pbDyu(Cd1nRk zD}+#s2;@CnpgI6T{YZVHK3$)yU)$Lsq)zIi^~w6FMvr4V7vSs{$*bfhd2Q=i_Od=s zCP{0uI zecisZ_x#>pZhytSdbEb0Z)b}gWP3?7DUe~zqNPE=2%7DX%@m45kk2JR%oPj8LdFc5 z!GIyj%|VSOApw#sSqUgM+ugP)4}sY&MJ@PXWb;s}*P4i@PFi-~q0M{i@%Y%|KY4sC z9#8firtUyU@g4cjONW(EK%oP*+x@xEpP;`#v^lbWAsTLvc0|t<5a^>h zzK#RT9lRXB_gl3^1KHgdjwEEwRG~Xj8ve^GJIoQD9=MKiWMITYP1prO>&zE!rOw z*{-q{YmW!hEh@uHZAtIR`;L#UZ+yuLQ`y~;4#p$Z?^S6s(zbf$^wYjyS0lTV?^eU< z{!}=e3hyf|yH!xRexM9HW3A1lQcPcC-tDyIcClrr~q zR;Lysv-`|c$jfTWO9Le#n`=siRDs^RBWBV!mT6;NWZ@Rt38&Cr=`k-_(!E$%xalz6 z-@tSydExCQ8hGM(swH{rxv|z7&k(jTW0+Z<*LG(H&)yL5!5se(PJS);C#%Maz4^(Y zpJ&4#oXqzYV^y}umF1w$m3pwul^uzYeZcQwlroS1fF16OycOvS+Xr-os}%o$9ZE#r zqC2(!fiWA{W;x%}A6rC&{XO|IS57lUe*ozdaE=r~djoz1N7i~M?v+PH-iVf$+186= z{{JfnW}zJB9sfb70l*nvoJ1ZlTCaBKAlvP{q>D z9@n&E6%0Yt%B50S6G3>CmbPh<=kV#8-lv~F;*rpm!DGh;J(kx|e_G4Qk{=+1z6tLV z13SD}hZ?2HU2EsA!3P{+5667~04{ScjE6nDk5@y$I~XZ}LW5L>pxxOH4ht0^uQeP~ ztndS{@U};4L?;C}uGh;WcKmZ5KcmgWaK- zIU{jqqCaqnt}#)}H>b+y%Bj>u>Zhm>W%->@S68Mh3fE=P<+6K{5Cjn)5k_6D97d2*bbAs5N(yjLmCGMbeJPy-T8lx%7sceysP@u@+vPV^Pqt!55J??L;ObpGGx zmr6q)H{iCc7?c5ZOZY%~pB0etRJUCSTdhr@fGmJ8ZRVQ20O^S?BjEP5n&`}+=r-(V zm<2@ z_*8I=vtQwPO7ZA&%c3XV77P zqNHlgiVA;xC}Jn{d$nioM_l_j_6{nzfKivgBqmV>PB+4aEgskJ~UR86HG z(c=ikpH1%GAXa%FA4x)4Xj<&E_Xn1O-e z0T7#I00r3Xm=^)rdw^IaBe$f&{5Fuq!1x4+9dh!M6L-n2U}9k4cmWh#l$%&lz?jU) z2b7Zl@)hzDb5jpE>n~5Ht8sp2NA28R+ND0bIH6i&djp7y~A& e#V^==Bi@Eth%d3ID8F1cCBHl`CqFR-s2%`m&ta1Q diff --git a/packages/ardrive_ui/assets/fonts/config.json b/packages/ardrive_ui/assets/fonts/config.json index e8f961e6af..3ced66c0c0 100644 --- a/packages/ardrive_ui/assets/fonts/config.json +++ b/packages/ardrive_ui/assets/fonts/config.json @@ -1111,6 +1111,132 @@ "search": [ "add-arns-name" ] + }, + { + "uid": "bef8eef79b616fc41195318d0518d5a2", + "css": "checked", + "code": 59475, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M498.5 83.3H501.5C558.5 83.3 603.3 83.3 639.6 85.8 676.6 88.3 707.7 93.6 736.6 105.5 808.1 135.1 864.9 191.9 894.5 263.4 906.4 292.3 911.7 323.4 914.2 360.4 916.7 396.7 916.7 441.5 916.7 498.5V501.5C916.7 558.5 916.7 603.3 914.2 639.6 911.7 676.6 906.4 707.7 894.5 736.6 864.9 808.1 808.1 864.9 736.6 894.5 707.7 906.4 676.6 911.7 639.6 914.2 603.3 916.7 558.5 916.7 501.5 916.7H498.5C441.5 916.7 396.7 916.7 360.4 914.2 323.4 911.7 292.3 906.4 263.4 894.5 191.9 864.9 135.1 808.1 105.5 736.6 93.6 707.7 88.3 676.6 85.8 639.6 83.3 603.3 83.3 558.5 83.3 501.5V498.5C83.3 441.5 83.3 396.7 85.8 360.4 88.3 323.4 93.6 292.3 105.5 263.4 135.1 191.9 191.9 135.1 263.4 105.5 292.3 93.6 323.4 88.3 360.4 85.8 396.7 83.3 441.5 83.3 498.5 83.3ZM366 168.9C333.3 171.2 312.3 175.5 295.3 182.5 244.2 203.7 203.7 244.2 182.5 295.3 175.5 312.3 171.2 333.3 168.9 366 166.7 399.2 166.7 441.2 166.7 500 166.7 558.8 166.7 600.8 168.9 634 171.2 666.7 175.5 687.7 182.5 704.7 203.7 755.8 244.2 796.3 295.3 817.5 312.3 824.5 333.3 828.8 366 831 399.2 833.3 441.2 833.3 500 833.3 558.8 833.3 600.8 833.3 634 831 666.7 828.8 687.7 824.5 704.7 817.5 755.8 796.3 796.3 755.8 817.5 704.7 824.5 687.7 828.8 666.7 831 634 833.3 600.8 833.3 558.8 833.3 500 833.3 441.2 833.3 399.2 831 366 828.8 333.3 824.5 312.3 817.5 295.3 796.3 244.2 755.8 203.7 704.7 182.5 687.7 175.5 666.7 171.2 634 168.9 600.8 166.7 558.8 166.7 500 166.7 441.2 166.7 399.2 166.7 366 168.9ZM622.3 375.8C641.3 362.9 667.3 367.8 680.2 386.8 693.2 405.8 688.3 431.7 669.3 444.7L665.1 447.5C592.3 497.3 531.7 562.9 487.9 639.5 481.4 650.7 470.1 658.4 457.3 660.1 444.4 661.8 431.5 657.4 422.3 648.3L324.7 550.8C308.4 534.6 308.4 508.2 324.7 491.9 341 475.6 367.3 475.6 383.6 491.9L444.2 552.4C490.8 484.3 549.7 425.4 618.1 378.7L622.3 375.8Z", + "width": 1000 + }, + "search": [ + "checked" + ] + }, + { + "uid": "3705687f93c0a3d09061eae46c8521de", + "css": "advanced-chevron", + "code": 59476, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M258 308.8C271.5 290.2 297.5 286.1 316.2 299.6 380 346 437.3 400.4 486.4 461.5 504.5 484 504.5 516 486.4 538.5 437.3 599.6 380 654 316.2 700.4 297.5 713.9 271.5 709.8 258 691.2 244.4 672.5 248.6 646.5 267.2 633 320.3 594.4 368.3 549.7 410.2 500 368.3 450.3 320.3 405.6 267.2 367 248.6 353.5 244.4 327.5 258 308.8ZM508 308.8C521.5 290.2 547.5 286.1 566.2 299.6 630 346 687.3 400.4 736.4 461.5 754.5 484 754.5 516 736.4 538.5 687.3 599.6 630 654 566.2 700.4 547.5 713.9 521.5 709.8 508 691.2 494.4 672.5 498.6 646.5 517.2 633 570.3 594.4 618.3 549.7 660.2 500 618.3 450.3 570.3 405.6 517.2 367 498.6 353.5 494.4 327.5 508 308.8Z", + "width": 1000 + }, + "search": [ + "advanced-chevron" + ] + }, + { + "uid": "706964788e106085036518e773b6fcb3", + "css": "chevron-up", + "code": 59477, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M500 475.9C549.7 517.7 594.4 565.7 633 618.8 646.5 637.5 672.5 641.6 691.2 628.1 709.8 614.5 713.9 588.5 700.4 569.9 654 506 599.6 448.8 538.5 399.6 516 381.5 484 381.5 461.5 399.6 400.4 448.8 346 506 299.6 569.9 286.1 588.5 290.2 614.5 308.8 628.1 327.5 641.6 353.5 637.5 367 618.8 405.6 565.7 450.3 517.7 500 475.9Z", + "width": 1000 + }, + "search": [ + "chevron-up" + ] + }, + { + "uid": "180aa3890229a0c151830935b2e3be87", + "css": "chevron-down", + "code": 59478, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M308.8 388.8C327.5 375.2 353.5 379.4 367 398 405.6 451.1 450.3 499.1 500 541 549.7 499.1 594.4 451.1 633 398 646.5 379.4 672.5 375.2 691.2 388.8 709.8 402.3 713.9 428.3 700.4 447 654 510.8 599.6 568.1 538.5 617.2 516 635.3 484 635.3 461.5 617.2 400.4 568.1 346 510.8 299.6 447 286.1 428.3 290.2 402.3 308.8 388.8Z", + "width": 1000 + }, + "search": [ + "chevron-down" + ] + }, + { + "uid": "10d5f58e1ba9636e231b874e02e3a5b9", + "css": "pic", + "code": 59472, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M414.8 83.3H585.2C641.9 83.3 687.1 83.3 723.6 86.3 760.9 89.4 792.7 95.7 821.8 110.6 868.9 134.5 907.1 172.8 931.1 219.8 957.2 271.1 958.2 334.4 958.3 427.9 958.3 437.6 958.3 447.8 958.3 458.3V543.5C958.3 600.3 958.3 645.4 955.4 681.9 952.3 719.2 945.9 751 931.1 780.2 907.1 827.2 868.9 865.5 821.8 889.4 792.7 904.3 760.9 910.6 723.6 913.7 687.1 916.7 641.9 916.7 585.2 916.7H416.4C385 916.7 357.3 916.7 333 916.2 268.8 915 220.1 910.8 178.2 889.4 131.1 865.5 92.9 827.2 68.9 780.2 54.1 751 47.7 719.2 44.6 681.9 41.7 645.4 41.7 600.3 41.7 543.5V456.5C41.7 399.7 41.7 354.5 44.6 318.1 47.7 280.8 54.1 249 68.9 219.8 92.9 172.8 131.1 134.5 178.2 110.6 207.3 95.7 239.1 89.4 276.4 86.3 312.9 83.3 358 83.3 414.8 83.3ZM283.2 169.4C251.1 172 231.4 177 216 184.8 184.6 200.8 159.1 226.3 143.2 257.7 135.3 273.1 130.3 292.7 127.7 324.9 125 357.5 125 399.3 125 458.3V541.7C125 600.7 125 642.5 127.7 675.1 130.3 707.3 135.3 726.9 143.2 742.3 159.1 773.7 184.6 799.2 216 815.2 233.8 824.3 256.4 829.2 295.6 831.5 327.3 574.2 546.6 375 812.5 375 833.5 375 854.2 376.2 874.6 378.7 873.4 313.4 869.2 282 856.8 257.7 840.9 226.3 815.4 200.8 784 184.8 768.6 177 748.9 172 716.8 169.4 684.1 166.7 642.4 166.7 583.3 166.7H416.7C357.6 166.7 315.9 166.7 283.2 169.4ZM875 462.8C854.6 459.8 833.7 458.3 812.5 458.3 592.1 458.3 409.8 621.3 379.4 833.3 391.1 833.3 403.5 833.3 416.7 833.3H583.3C642.4 833.3 684.1 833.3 716.8 830.6 748.9 828 768.6 823 784 815.2 815.4 799.2 840.9 773.7 856.8 742.3 864.7 726.9 869.7 707.3 872.3 675.1 875 642.5 875 600.7 875 541.7V462.8ZM208.3 354.2C208.3 296.6 255 250 312.5 250 370 250 416.7 296.6 416.7 354.2 416.7 411.7 370 458.3 312.5 458.3 255 458.3 208.3 411.7 208.3 354.2ZM312.5 333.3C301 333.3 291.7 342.7 291.7 354.2 291.7 365.7 301 375 312.5 375 324 375 333.3 365.7 333.3 354.2 333.3 342.7 324 333.3 312.5 333.3Z", + "width": 1000 + }, + "search": [ + "pic" + ] + }, + { + "uid": "226e2be46a3c7645e3541de57acb894e", + "css": "box", + "code": 59473, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M498.5 83.3H501.5C558.5 83.3 603.3 83.3 639.6 85.8 676.6 88.3 707.7 93.6 736.6 105.5 808.1 135.1 864.9 191.9 894.5 263.4 906.4 292.3 911.7 323.4 914.2 360.4 916.7 396.7 916.7 441.5 916.7 498.5V501.5C916.7 558.5 916.7 603.3 914.2 639.6 911.7 676.6 906.4 707.7 894.5 736.6 864.9 808.1 808.1 864.9 736.6 894.5 707.7 906.4 676.6 911.7 639.6 914.2 603.3 916.7 558.5 916.7 501.5 916.7H498.5C441.5 916.7 396.7 916.7 360.4 914.2 323.4 911.7 292.3 906.4 263.4 894.5 191.9 864.9 135.1 808.1 105.5 736.6 93.6 707.7 88.3 676.6 85.8 639.6 83.3 603.3 83.3 558.5 83.3 501.5V498.5C83.3 441.5 83.3 396.7 85.8 360.4 88.3 323.4 93.6 292.3 105.5 263.4 135.1 191.9 191.9 135.1 263.4 105.5 292.3 93.6 323.4 88.3 360.4 85.8 396.7 83.3 441.5 83.3 498.5 83.3ZM366 168.9C333.3 171.2 312.3 175.5 295.3 182.5 244.2 203.7 203.7 244.2 182.5 295.3 175.5 312.3 171.2 333.3 168.9 366 166.7 399.2 166.7 441.2 166.7 500 166.7 558.8 166.7 600.8 168.9 634 171.2 666.7 175.5 687.7 182.5 704.7 203.7 755.8 244.2 796.3 295.3 817.5 312.3 824.5 333.3 828.8 366 831 399.2 833.3 441.2 833.3 500 833.3 558.8 833.3 600.8 833.3 634 831 666.7 828.8 687.7 824.5 704.7 817.5 755.8 796.3 796.3 755.8 817.5 704.7 824.5 687.7 828.8 666.7 831 634 833.3 600.8 833.3 558.8 833.3 500 833.3 441.2 833.3 399.2 831 366 828.8 333.3 824.5 312.3 817.5 295.3 796.3 244.2 755.8 203.7 704.7 182.5 687.7 175.5 666.7 171.2 634 168.9 600.8 166.7 558.8 166.7 500 166.7 441.2 166.7 399.2 166.7 366 168.9Z", + "width": 1000 + }, + "search": [ + "box" + ] + }, + { + "uid": "4573ed6a9fd2c8bef3149720367244a7", + "css": "turbo-coin", + "code": 59482, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M684.8 440.3H676.5C669.6 440.3 664 434.9 664 428.2V419.8H588.5C586 419.8 584.1 421.7 584.1 424.1 584.1 426.5 586 428.4 588.5 428.4H641.5C654 452 661.1 478.8 661.1 507.2 661.1 602.9 580.8 680.5 481.9 680.5 382.9 680.5 302.7 602.9 302.7 507.2 302.7 411.9 382.1 334.6 480.4 333.9L481.9 333.9H664V331.6C664 325 669.6 319.5 676.5 319.5H684.8C691.7 319.5 697.3 325 697.3 331.6V428.2C697.3 434.9 691.7 440.3 684.8 440.3ZM481.9 565.9C515.4 565.9 542.6 539.6 542.6 507.2 542.6 474.7 515.4 448.4 481.9 448.4 448.3 448.4 421.2 474.7 421.2 507.2 421.2 539.6 448.3 565.9 481.9 565.9Z", + "width": 1000 + }, + "search": [ + "turbo-coin" + ] + }, + { + "uid": "32ad12ed305e898241cb8c18c26feea0", + "css": "arweave-coin", + "code": 59483, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M580.2 651.8C577.3 648.9 577.3 643.2 574.5 637.5 574.5 631.7 571.6 626 571.6 620.3 565.9 626 560.2 628.9 554.4 634.6 548.7 640.3 540.1 643.2 534.4 646 525.8 648.9 520.1 651.8 508.6 654.6 500 657.5 488.6 657.5 480 657.5 462.8 657.5 448.5 654.6 434.2 648.9 419.8 643.2 408.4 637.5 396.9 628.9 385.5 620.3 379.8 608.8 374 597.4 368.3 585.9 365.4 571.6 365.4 557.3 365.4 522.9 379.8 494.3 405.5 477.1 431.3 457.1 471.4 448.5 522.9 448.5H571.6V428.4C571.6 411.2 565.9 399.8 557.3 391.2 545.8 382.6 531.5 376.9 511.5 376.9 494.3 376.9 482.8 379.7 474.3 388.3 465.7 396.9 462.8 405.5 462.8 417H376.9C376.9 402.6 379.8 388.3 385.5 376.9 391.2 365.4 399.8 354 414.1 342.5 425.6 333.9 439.9 325.3 457.1 319.6 474.3 313.9 494.3 311 517.2 311 537.3 311 554.4 313.9 571.6 319.6 588.8 325.3 603.1 331 617.4 342.5 628.9 351.1 640.3 365.4 646.1 379.7 651.8 394 657.5 411.2 657.5 431.3V574.5C657.5 591.6 657.5 606 660.4 617.4 663.3 628.9 666.1 640.3 669 646V651.8H580.2ZM497.2 591.6C505.8 591.6 514.3 591.6 520.1 588.8 528.7 585.9 534.4 583 540.1 580.2 545.8 577.3 551.6 574.5 554.4 568.7 557.3 565.9 563 560.1 565.9 557.3V500H522.9C508.6 500 497.2 500 488.6 502.9 480 505.7 471.4 508.6 465.7 514.3 459.9 520 454.2 522.9 451.3 531.5 448.5 537.2 448.5 545.8 448.5 551.5 448.5 563 451.3 571.6 459.9 580.2 468.5 588.8 482.8 591.6 497.2 591.6ZM500 114.8C287.3 114.8 114.8 287.3 114.8 500 114.8 712.7 287.3 885.2 500 885.2 712.7 885.2 885.2 712.7 885.2 500 885.2 287.3 712.7 114.8 500 114.8ZM43.3 500C43.3 247.7 247.7 43.3 500 43.3 752.2 43.3 956.7 247.7 956.7 500 956.7 752.2 752.2 956.7 500 956.7 247.7 956.7 43.3 752.2 43.3 500ZM508.6 654.6C516.2 652.7 521.3 650.8 526.4 648.9 529 648 531.5 647 534.4 646 535.7 645.4 537.2 644.7 538.8 644 541.1 643 543.5 641.9 545.8 640.7 547.6 639.7 549.4 638.7 551 637.5 552.2 636.6 553.4 635.6 554.4 634.6 557.3 631.7 560.1 629.6 563 627.4 565.9 625.3 568.7 623.1 571.6 620.3 571.6 623.1 572.3 626 573 628.9 573.8 631.7 574.5 634.6 574.5 637.5 575.7 640 576.4 642.5 577.1 644.7 577.7 647.2 578.3 649.3 579.5 650.9 579.7 651.2 579.9 651.5 580.2 651.8H669V646C666.6 641.3 664.2 632.5 661.8 623.1 661.3 621.2 660.9 619.3 660.4 617.4 657.5 606 657.5 591.6 657.5 574.5V431.3C657.5 411.2 651.8 394 646.1 379.7 640.3 365.4 628.9 351.1 617.4 342.5 603.1 331 588.8 325.3 571.6 319.6 554.4 313.9 537.2 311 517.2 311 494.3 311 474.2 313.9 457.1 319.6 439.9 325.3 425.6 333.9 414.1 342.5 399.8 354 391.2 365.4 385.5 376.9 383.7 380.4 382.2 384.3 381 388.3 378.2 397.2 376.9 407.1 376.9 417H462.8C462.8 405.5 465.6 396.9 474.2 388.3 482.8 379.7 494.3 376.9 511.5 376.9 531.5 376.9 545.8 382.6 557.3 391.2 564.4 398.3 569.5 407.3 571.1 419.8 571.4 422.5 571.6 425.4 571.6 428.4V448.5H522.9C471.4 448.5 431.3 457 405.5 477.1 379.7 494.3 365.4 522.9 365.4 557.3 365.4 571.6 368.3 585.9 374 597.4 379.7 608.8 385.5 620.3 396.9 628.9 408.4 637.5 419.8 643.2 434.2 648.9 448.5 654.6 462.8 657.5 480 657.5 488.6 657.5 500 657.5 508.6 654.6ZM439.8 388.3C443.2 380.6 448.1 374 454 368.1 470.7 351.4 491.7 348.2 511.5 348.2 537.7 348.2 558.1 356 574.5 368.3L576.1 369.5 577.5 370.9C591.6 385 600.2 403.7 600.2 428.4V477.1H594.5V556.9L600.2 551.1V619.5C600.3 619.8 600.5 620.6 600.8 621.9 600.9 622.1 600.9 622.2 600.9 622.4 601 622.6 601.1 622.9 601.1 623.1H632.3C628.9 608.5 628.9 591.6 628.9 576.6 628.9 575.9 628.9 575.2 628.9 574.5V431.3C628.9 416.7 624.7 403.6 619.5 390.4 615.8 381.2 607.7 371 600.2 365.4L599.9 365.1 599.5 364.9C589.2 356.6 578.8 352.2 562.5 346.8 548.4 342 534.2 339.6 517.2 339.6 496.6 339.6 479.7 342.2 466.1 346.8 452.7 351.2 441.2 358 431.6 365.1 421.4 373.4 415.6 381.1 411.8 388.3H439.8ZM554.4 568.7L565.9 557.3V500H522.9C508.6 500 497.1 500 488.6 502.9 480 505.7 471.4 508.6 465.6 514.3 464.2 515.8 462.7 517.1 461.3 518.3 457.2 521.9 453.5 525.1 451.3 531.5 448.5 537.2 448.5 545.8 448.5 551.5 448.5 563 451.3 571.6 459.9 580.2 468.5 588.8 482.8 591.6 497.1 591.6 505.7 591.6 514.3 591.6 520.1 588.8 528.6 585.9 534.4 583 540.1 580.2 545.8 577.3 551.6 574.5 554.4 568.7ZM530.6 615.4C523.8 618.4 517 619.4 512.3 619.8 507 620.3 501.6 620.3 497.6 620.3L497.1 620.3C481 620.3 456.7 617.4 439.7 600.4 433 593.8 427.7 586.2 424.3 577.2 420.9 568.4 419.8 559.7 419.8 551.5L419.8 551.2C419.8 548.5 419.8 543.7 420.3 538.7 420.8 534.2 421.8 527.5 424.8 520.7 428 512.1 432.6 506.1 437.2 501.6 439.1 499.6 441.1 497.9 442.3 496.8 442.4 496.8 442.5 496.7 442.6 496.6 444 495.4 444.8 494.7 445.4 494.1 450 489.5 455.3 486 460.4 483.3 444.3 487.2 432 492.8 423.1 499.7L422.3 500.3 421.4 500.9C404.6 512.1 394.1 531.3 394.1 557.3 394.1 568.1 396.3 577.9 399.6 584.6 405.7 596.7 408.8 602 414.1 606 422.9 612.5 431.8 617.1 444.8 622.3 455.7 626.7 466.3 628.9 480 628.9 489.9 628.9 496.3 628.6 499.6 627.5L500.6 627.1 501.7 626.9C507.9 625.3 510.8 624.2 514.7 622.7 517 621.8 519.7 620.8 523.5 619.5 524.8 618.9 526.1 618.3 527 617.9 527.2 617.8 527.3 617.8 527.4 617.7 529.1 616.9 530.4 616.4 531.6 615.8 533.6 614.8 534.2 614.3 534.3 614.2M530.6 615.4C532 615 533.3 614.5 534.5 614L530.6 615.4Z", + "width": 1000 + }, + "search": [ + "arweave-coin" + ] + }, + { + "uid": "28fb2839a66640875ede1bd404024968", + "css": "license-1", + "code": 59471, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M500 125C361.9 125 250 236.9 250 375 250 452.3 285 521.3 340.1 567.2 383.5 603.3 439.2 625 500 625 565.2 625 624.6 600.1 669.1 559.1 718.9 513.4 750 447.9 750 375 750 236.9 638.1 125 500 125ZM166.7 375C166.7 190.9 315.9 41.7 500 41.7 684.1 41.7 833.3 190.9 833.3 375 833.3 463.3 799 543.6 743 603.2L811.5 907.5C815.2 923.9 808.7 940.8 795 950.6 781.4 960.3 763.3 960.9 749 952.2L734.1 943C591.9 855.5 411.9 858.8 273.1 951.3 259.1 960.7 240.8 960.7 226.8 951.3 212.8 941.9 205.8 925 209.1 908.5L268 614.3C205.5 553.8 166.7 468.9 166.7 375ZM342.1 668.6L308.3 837.8C436.2 782.7 581.7 782.3 710.2 837.1L670.7 661.4C620.8 691.2 562.4 708.3 500 708.3 442.9 708.3 389.1 694 342.1 668.6Z", + "width": 1000 + }, + "search": [ + "license" + ] } ] } \ No newline at end of file diff --git a/packages/ardrive_ui/lib/src/components/card.dart b/packages/ardrive_ui/lib/src/components/card.dart index 3a7c931fae..63237949ae 100644 --- a/packages/ardrive_ui/lib/src/components/card.dart +++ b/packages/ardrive_ui/lib/src/components/card.dart @@ -46,7 +46,7 @@ class ArDriveCard extends StatelessWidget { ), ), child: ClipRRect( - clipBehavior: Clip.hardEdge, + clipBehavior: Clip.antiAlias, borderRadius: BorderRadius.circular( borderRadius ?? cardDefaultBorderRadius, ), diff --git a/packages/ardrive_ui/lib/src/components/check_box.dart b/packages/ardrive_ui/lib/src/components/check_box.dart index d9f87eafc5..aefe95e22a 100644 --- a/packages/ardrive_ui/lib/src/components/check_box.dart +++ b/packages/ardrive_ui/lib/src/components/check_box.dart @@ -13,6 +13,7 @@ class ArDriveCheckBox extends StatefulWidget { this.titleStyle, this.onChange, this.titleWidget, + this.useNewIcons = true, }); /// Initial state of the checkbox. @@ -29,6 +30,8 @@ class ArDriveCheckBox extends StatefulWidget { final TextStyle? titleStyle; final Function(bool value)? onChange; + final bool useNewIcons; + @override State createState() => ArDriveCheckBoxState(); } @@ -87,47 +90,75 @@ class ArDriveCheckBoxState extends State { } widget.onChange?.call(checked); }, - child: ArDriveClickArea( - child: Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - state == CheckBoxState.indeterminate - ? ArDriveIcon( - icon: ArDriveIconsData.minus_rectangle, - size: 22, - color: ArDriveTheme.of(context) - .themeData - .colors - .themeFgDefault, - ) - : AnimatedContainer( - height: 18.5, - width: 18.5, - margin: const EdgeInsets.fromLTRB(3.25, 3.5, 5, 4), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(checkboxBorderRadius), - border: Border.all( - color: _boxColor(), - width: 2, - ), - color: _backgroundColor(), - ), - duration: const Duration(milliseconds: 300), - child: checked - ? ArDriveIcon( - icon: ArDriveIconsData.checkmark, - size: 12, - color: _checkColor(), - ) - : null, - ), - if (_buildTitle() != null) ...[ - const SizedBox(width: 8.0), - _buildTitle()!, - ] - ], - ), + child: widget.useNewIcons + ? _buildNewIcons() + : ArDriveClickArea( + child: Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + state == CheckBoxState.indeterminate + ? ArDriveIcon( + icon: ArDriveIconsData.minus_rectangle, + size: 22, + color: ArDriveTheme.of(context) + .themeData + .colors + .themeFgDefault, + ) + : AnimatedContainer( + height: 18.5, + width: 18.5, + margin: const EdgeInsets.fromLTRB(3.25, 3.5, 5, 4), + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(checkboxBorderRadius), + border: Border.all( + color: _boxColor(), + width: 2, + ), + color: _backgroundColor(), + ), + duration: const Duration(milliseconds: 300), + child: checked + ? ArDriveIcon( + icon: ArDriveIconsData.checkmark, + size: 12, + color: _checkColor(), + ) + : null, + ), + if (_buildTitle() != null) ...[ + const SizedBox(width: 8.0), + _buildTitle()!, + ] + ], + ), + ), + ); + } + + Widget _buildNewIcons() { + return ArDriveClickArea( + child: Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + state == CheckBoxState.indeterminate + ? ArDriveIcon( + icon: ArDriveIconsData.minus_rectangle, + size: 22, + color: + ArDriveTheme.of(context).themeData.colors.themeFgDefault, + ) + : checked + ? ArDriveIcons.checked() + : ArDriveIcons.box(), + if (_buildTitle() != null) ...[ + const SizedBox(width: 8.0), + _buildTitle()!, + ] + ], ), ); } diff --git a/packages/ardrive_ui/lib/src/components/click_area.dart b/packages/ardrive_ui/lib/src/components/click_area.dart index 0e71e2ac4a..3c5c9ef696 100644 --- a/packages/ardrive_ui/lib/src/components/click_area.dart +++ b/packages/ardrive_ui/lib/src/components/click_area.dart @@ -1,3 +1,4 @@ +import 'package:ardrive_ui/ardrive_ui.dart'; import 'package:flutter/material.dart'; class ArDriveClickArea extends StatelessWidget { @@ -14,7 +15,7 @@ class ArDriveClickArea extends StatelessWidget { @override Widget build(BuildContext context) { - return Tooltip( + return ArDriveTooltip( message: tooltip ?? '', child: MouseRegion( cursor: diff --git a/packages/ardrive_ui/lib/src/components/modal.dart b/packages/ardrive_ui/lib/src/components/modal.dart index e16ad851f7..a323ab1230 100644 --- a/packages/ardrive_ui/lib/src/components/modal.dart +++ b/packages/ardrive_ui/lib/src/components/modal.dart @@ -61,7 +61,13 @@ class ArDriveModalNew extends StatelessWidget { SizedBox( height: 6, child: Container( - color: colorTokens.containerRed, + decoration: BoxDecoration( + color: colorTokens.containerRed, + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(modalBorderRadius), + topRight: Radius.circular(modalBorderRadius), + ), + ), ), ), Padding( diff --git a/packages/ardrive_ui/lib/src/styles/icons/ar_drive_icons_icons.dart b/packages/ardrive_ui/lib/src/styles/icons/ar_drive_icons_icons.dart index 03919c3646..9ea066fd02 100644 --- a/packages/ardrive_ui/lib/src/styles/icons/ar_drive_icons_icons.dart +++ b/packages/ardrive_ui/lib/src/styles/icons/ar_drive_icons_icons.dart @@ -1,3 +1,5 @@ +// ignore_for_file: constant_identifier_names + /// Flutter icons ArDriveIcons /// Copyright (C) 2024 by original authors @ fluttericon.com, fontello.com /// This font was generated by FlutterIcon.com, which is derived from Fontello. @@ -13,8 +15,6 @@ /// /// /// -// ignore_for_file: constant_identifier_names - library; import 'package:flutter/widgets.dart'; @@ -181,6 +181,24 @@ class ArDriveIconsData { IconData(0xe84d, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData add_arns_name = IconData(0xe84e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData license_1 = + IconData(0xe84f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData pic = + IconData(0xe850, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData box = + IconData(0xe851, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData checked = + IconData(0xe853, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData advanced_chevron = + IconData(0xe854, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData chevron_up = + IconData(0xe855, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData chevron_down = + IconData(0xe856, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData turbo_coin = + IconData(0xe85a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData arweave_coin = + IconData(0xe85b, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData arrow_download = IconData(0xe880, fontFamily: _kFontFam, fontPackage: _kFontPkg); } diff --git a/packages/ardrive_ui/lib/src/styles/icons/icons.dart b/packages/ardrive_ui/lib/src/styles/icons/icons.dart index a3dafe11af..f5c239d651 100644 --- a/packages/ardrive_ui/lib/src/styles/icons/icons.dart +++ b/packages/ardrive_ui/lib/src/styles/icons/icons.dart @@ -484,4 +484,52 @@ class ArDriveIcons { size: size, color: color, ); + + static ArDriveIcon turboCoin({double? size, Color? color}) => ArDriveIcon( + icon: ArDriveIconsData.turbo_coin, + size: size, + color: color, + ); + + static ArDriveIcon arweaveCoin({double? size, Color? color}) => ArDriveIcon( + icon: ArDriveIconsData.arweave_coin, + size: size, + color: color, + ); + + static ArDriveIcon chevronDown({double? size, Color? color}) => ArDriveIcon( + icon: ArDriveIconsData.chevron_down, + size: size, + color: color, + ); + + static ArDriveIcon chevronUp({double? size, Color? color}) => ArDriveIcon( + icon: ArDriveIconsData.chevron_up, + size: size, + color: color, + ); + + static ArDriveIcon arrowDownload({double? size, Color? color}) => ArDriveIcon( + icon: ArDriveIconsData.arrow_download, + size: size, + color: color, + ); + + static ArDriveIcon box({double? size, Color? color}) => ArDriveIcon( + icon: ArDriveIconsData.box, + size: size, + color: color, + ); + + static ArDriveIcon checked({double? size, Color? color}) => ArDriveIcon( + icon: ArDriveIconsData.checked, + size: size, + color: color, + ); + + static ArDriveIcon license1({double? size, Color? color}) => ArDriveIcon( + icon: ArDriveIconsData.license_1, + size: size, + color: color, + ); } From 0275e7e3a4b0f6f53e705d26c9083b81faab1b1d Mon Sep 17 00:00:00 2001 From: Thiago Carvalho <32248947+thiagocarvalhodev@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:11:45 -0300 Subject: [PATCH 2/6] chore: remove delay and remove license info link --- lib/blocs/upload/upload_cubit.dart | 1 - lib/components/fs_entry_license_form.dart | 2 -- 2 files changed, 3 deletions(-) diff --git a/lib/blocs/upload/upload_cubit.dart b/lib/blocs/upload/upload_cubit.dart index 5e5a450203..f6e6cb58ef 100644 --- a/lib/blocs/upload/upload_cubit.dart +++ b/lib/blocs/upload/upload_cubit.dart @@ -642,7 +642,6 @@ class UploadCubit extends Cubit { Future startUploadPreparation({ bool isRetryingToPayWithTurbo = false, }) async { - await Future.delayed(const Duration(seconds: 5)); _arnsRepository.getAntRecordsForWallet(_auth.currentUser.walletAddress); _files diff --git a/lib/components/fs_entry_license_form.dart b/lib/components/fs_entry_license_form.dart index 6afcd9a741..45b1f4947e 100644 --- a/lib/components/fs_entry_license_form.dart +++ b/lib/components/fs_entry_license_form.dart @@ -1,6 +1,5 @@ import 'package:ardrive/blocs/blocs.dart'; import 'package:ardrive/components/license/cc_type_form.dart'; -import 'package:ardrive/components/license/learn_about_licensing.dart'; import 'package:ardrive/components/license/udl_params_form.dart'; import 'package:ardrive/components/license_summary.dart'; import 'package:ardrive/core/crypto/crypto.dart'; @@ -252,7 +251,6 @@ class _FsEntryLicenseFormState extends State { ), ), ), - const LearnAboutLicensing(), const Divider(height: 32), Text( // TODO: Localize From 3782941ccd72112f2ae76abf8a0d4d4367a44b2e Mon Sep 17 00:00:00 2001 From: Thiago Carvalho <32248947+thiagocarvalhodev@users.noreply.github.com> Date: Thu, 26 Sep 2024 14:34:15 -0300 Subject: [PATCH 3/6] fixing tests --- lib/blocs/upload/upload_cubit.dart | 5 +++-- test/blocs/upload_cubit_test.dart | 9 ++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/blocs/upload/upload_cubit.dart b/lib/blocs/upload/upload_cubit.dart index 4570b35267..c6c5ae0114 100644 --- a/lib/blocs/upload/upload_cubit.dart +++ b/lib/blocs/upload/upload_cubit.dart @@ -307,7 +307,7 @@ class UploadCubit extends Cubit { Future _getTotalSize() async { int size = 0; - for (final file in files) { + for (final file in _files) { size += await file.ioFile.length; } @@ -654,7 +654,8 @@ class UploadCubit extends Cubit { Future startUploadPreparation({ bool isRetryingToPayWithTurbo = false, }) async { - _arnsRepository.getAntRecordsForWallet(_auth.currentUser.walletAddress); + final walletAddress = await _auth.getWalletAddress(); + _arnsRepository.getAntRecordsForWallet(walletAddress!); _files .removeWhere((file) => filesNamesToExclude.contains(file.ioFile.name)); diff --git a/test/blocs/upload_cubit_test.dart b/test/blocs/upload_cubit_test.dart index 6f91b841c9..caa101ff6c 100644 --- a/test/blocs/upload_cubit_test.dart +++ b/test/blocs/upload_cubit_test.dart @@ -1,6 +1,7 @@ import 'dart:io'; import 'dart:typed_data'; +import 'package:ardrive/arns/domain/arns_repository.dart'; import 'package:ardrive/authentication/ardrive_auth.dart'; import 'package:ardrive/blocs/profile/profile_cubit.dart'; import 'package:ardrive/blocs/upload/models/upload_file.dart'; @@ -30,7 +31,6 @@ import 'package:mocktail/mocktail.dart'; import 'package:pst/pst.dart'; import '../core/upload/uploader_test.dart'; -import '../manifest/domain/manifest_repository_test.dart'; import '../test_utils/utils.dart'; import 'drives_cubit_test.dart'; @@ -57,6 +57,8 @@ class MockUploadRepository extends Mock implements UploadRepository {} class MockArDriveUploadPreparationManager extends Mock implements ArDriveUploadPreparationManager {} +class MockArnsRepository extends Mock implements ARNSRepository {} + // TODO(thiagocarvalhodev): Test the case of remove files before download when pass ConflictingFileActions.SKIP. // TODO: Test startUpload void main() { @@ -353,8 +355,9 @@ void main() { return getUploadCubitInstanceWith(tAllConflictingFiles); }, act: (cubit) async { - when(() => mockArnsRepository.getAntRecordsForWallet(any(), - update: any(named: 'update'))) + when(() => mockArDriveAuth.getWalletAddress()) + .thenAnswer((invocation) => Future.value(tWalletAddress)); + when(() => mockArnsRepository.getAntRecordsForWallet(tWalletAddress!)) .thenAnswer((invocation) => Future.value([])); await cubit.startUploadPreparation(); await cubit.checkConflictingFiles(); From 0fb1188a719a6d7a3b1310093228aadb30b75efc Mon Sep 17 00:00:00 2001 From: Thiago Carvalho <32248947+thiagocarvalhodev@users.noreply.github.com> Date: Fri, 27 Sep 2024 11:04:38 -0300 Subject: [PATCH 4/6] add new icons and fix tests --- lib/components/upload_form.dart | 3 +- .../ardrive_ui/assets/fonts/ArDriveIcons.ttf | Bin 25472 -> 25628 bytes packages/ardrive_ui/assets/fonts/config.json | 30 +++++++++--------- .../styles/icons/ar_drive_icons_icons.dart | 11 +++---- .../lib/src/styles/icons/icons.dart | 2 +- .../test/src/components/check_box_test.dart | 2 ++ test/blocs/upload_cubit_test.dart | 6 ++-- 7 files changed, 28 insertions(+), 26 deletions(-) diff --git a/lib/components/upload_form.dart b/lib/components/upload_form.dart index 267355e56c..fe7591054e 100644 --- a/lib/components/upload_form.dart +++ b/lib/components/upload_form.dart @@ -1301,7 +1301,7 @@ class _UploadReadyWidget extends StatelessWidget { ], ), ), - Divider(), + const Divider(), if (state.paymentInfo.isFreeThanksToTurbo) ...[ const SizedBox(height: 8), Text( @@ -1317,6 +1317,7 @@ class _UploadReadyWidget extends StatelessWidget { RepositoryProvider.value( value: context.read(), child: UploadPaymentMethodView( + useDropdown: true, onError: () { context.read().emitErrorFromPreparation(); }, diff --git a/packages/ardrive_ui/assets/fonts/ArDriveIcons.ttf b/packages/ardrive_ui/assets/fonts/ArDriveIcons.ttf index 0a4ca5951db7bb3f424908a5ee430030a5b8a90b..6c91bc2d56fcee149d1ebd72ed792b07e298a682 100644 GIT binary patch delta 1036 zcmZWoO>7%Q6n<}JXZF{-UVDF>5|iMq?U*J`?AkFQfr4733V|>wY2$)gHg#x&(zuv} z6p4}^5eJ}M4p3F%kRCZ8rCbn#9FTwu2yRG72q7c`7Y-nCKr*wgppBR}Pw!{u``#OA z-sR8n`WN_CCHU&vdjRw(0G~g*`toz{e$)LDKx+cb??1O3wo4DEf4lP3_}oJF`8NR6 z>i}@`e0cE!uHyXwm=W>lT6lhW_weL4z%%QDYwAMh#q~?ye)l!N=^Fsj=9Q1f@7q4h zUpsBh{Rukl2@L!+d@g_6_E+dH^q7bhAaPbK6xzb_&M2-BtJS;Q?*sIpceHn`x482T z{gK&=A|Vux3)_k{dR^V+V-JpfR7&kMwff_CsQ~@A=_hmy94NsVxCo!Z&+s>va3V@( z{OHo6w^f+LTA^+d3r!4ig`$w!bYprJ>$PGb$K9aT5Mg7w>U*~&i;i&IVs-iuid_$K z7V;SFI-bw}N3n-wFU<&g{-bVCk6RGCDB8dQ7pJ1&!KygVV&FEiu{~ILAih$Z!LsO6 z=0g0&ptyjVq@gQrdjFFZD_!%CtGewwBeO$E z#n95KK`4LUPNq!kvTCaRmFiMB@N9>R!fPj<5{Mg&LrK0%~h3Cu9*Ja z?wg~!ZSXn92xrC&C6XXBOgnRk+y-)zObDpB$Ly5N24Feq4ZvJCI3guPB1CXfnN(bW@WOh>1(UL-$~j&@IsZjEoW!t_|CoexWDmiBNlby58!<&U y#S{%e10cUse>$h+<*>WC9KN)yt#5RfIumC)D{E%h?RGXN+MUg{)lS$J(0>5ybiZi; delta 926 zcmYL^O>9(E6vxlG_uc!x-^`nNA9OOq4D;|!TgrTYNURc-gvP`;1=7$?q>grkLg|oF zttLiTxMBg~b3q83#w`ny%EH7L!a|J+Au%kP5KWAmamj+EsrOA6zW2_(`Ty_zpWk`+ ze#Ps*;McWa_wF_Tode*f&aZv`adLI;B!JchnE&d+puaNpM)}h1Gc&Vio?O@kQ11c2 z_m}&hUBNZ10N??k3+w&MgGX;yz60nz6TPZehF3RFoqN#$Se5{!FK+)h^Q!sa-`sLy z_9f_aBr@=K=H=l3eQ%ZiLr)8>0Eu1kpr}O*b_%#k61~y&y*+>tjOIqCM@u_*=wHlU z5{4*P5PL7K=!W`;hr5#(Cm-*0wbr}lxEJ|>q@f5$qCc0)QM*^ThIeJADB)D4TP}Cc zy;mVZu@9L1Ww90nwW9b-fW2?&PjnJm@D41)COm}a@B$B_ID93nU^8r4B!LzN#Znnd zVYA(7zlN=5DJ*g~h*hWEs2@b%%c0|YzFVrdkE8fnK~dItoOFesj&g5KU1RZ4ryeiD zbK~ocmVkt>W3yByBEk1xx6y3ZeJ_u$@GQ|d1~lq)49lZn1#ZXnt2MVV&W5F9SQaCW z(|#vr$DQ`sjqyZ6M%!m+j*}Av38jXt8=CE896zJ0u5)<4mPj}Kg`_)?$`rHhP&Ejr z_ia;^3}PI~C@IDiNjI|5)3f3G_`9q*gd$P7SSaG6L)X#ju|zl7f^d66KT= zO-#ylgX@J`BAT;RW{XDLux;NmlZulwr>nN-XbPIT>NwO3YF&PUVj}-daw4JWmdp*+ zdN}4#lw(k|y_B_VJ;^kaNDPr6?mX_blqqfVlZ_9DM?V^_t{eT0twI0O!B|-Rjg8^f O(UsxW`r5F+0`MPg`=HSP diff --git a/packages/ardrive_ui/assets/fonts/config.json b/packages/ardrive_ui/assets/fonts/config.json index 3ced66c0c0..62dad3bc87 100644 --- a/packages/ardrive_ui/assets/fonts/config.json +++ b/packages/ardrive_ui/assets/fonts/config.json @@ -1197,45 +1197,45 @@ ] }, { - "uid": "4573ed6a9fd2c8bef3149720367244a7", - "css": "turbo-coin", - "code": 59482, + "uid": "28fb2839a66640875ede1bd404024968", + "css": "license-1", + "code": 59471, "src": "custom_icons", "selected": true, "svg": { - "path": "M684.8 440.3H676.5C669.6 440.3 664 434.9 664 428.2V419.8H588.5C586 419.8 584.1 421.7 584.1 424.1 584.1 426.5 586 428.4 588.5 428.4H641.5C654 452 661.1 478.8 661.1 507.2 661.1 602.9 580.8 680.5 481.9 680.5 382.9 680.5 302.7 602.9 302.7 507.2 302.7 411.9 382.1 334.6 480.4 333.9L481.9 333.9H664V331.6C664 325 669.6 319.5 676.5 319.5H684.8C691.7 319.5 697.3 325 697.3 331.6V428.2C697.3 434.9 691.7 440.3 684.8 440.3ZM481.9 565.9C515.4 565.9 542.6 539.6 542.6 507.2 542.6 474.7 515.4 448.4 481.9 448.4 448.3 448.4 421.2 474.7 421.2 507.2 421.2 539.6 448.3 565.9 481.9 565.9Z", + "path": "M500 125C361.9 125 250 236.9 250 375 250 452.3 285 521.3 340.1 567.2 383.5 603.3 439.2 625 500 625 565.2 625 624.6 600.1 669.1 559.1 718.9 513.4 750 447.9 750 375 750 236.9 638.1 125 500 125ZM166.7 375C166.7 190.9 315.9 41.7 500 41.7 684.1 41.7 833.3 190.9 833.3 375 833.3 463.3 799 543.6 743 603.2L811.5 907.5C815.2 923.9 808.7 940.8 795 950.6 781.4 960.3 763.3 960.9 749 952.2L734.1 943C591.9 855.5 411.9 858.8 273.1 951.3 259.1 960.7 240.8 960.7 226.8 951.3 212.8 941.9 205.8 925 209.1 908.5L268 614.3C205.5 553.8 166.7 468.9 166.7 375ZM342.1 668.6L308.3 837.8C436.2 782.7 581.7 782.3 710.2 837.1L670.7 661.4C620.8 691.2 562.4 708.3 500 708.3 442.9 708.3 389.1 694 342.1 668.6Z", "width": 1000 }, "search": [ - "turbo-coin" + "license" ] }, { - "uid": "32ad12ed305e898241cb8c18c26feea0", - "css": "arweave-coin", - "code": 59483, + "uid": "6370e638b249eee39121de66c004cc7a", + "css": "turbo-coin", + "code": 59481, "src": "custom_icons", "selected": true, "svg": { - "path": "M580.2 651.8C577.3 648.9 577.3 643.2 574.5 637.5 574.5 631.7 571.6 626 571.6 620.3 565.9 626 560.2 628.9 554.4 634.6 548.7 640.3 540.1 643.2 534.4 646 525.8 648.9 520.1 651.8 508.6 654.6 500 657.5 488.6 657.5 480 657.5 462.8 657.5 448.5 654.6 434.2 648.9 419.8 643.2 408.4 637.5 396.9 628.9 385.5 620.3 379.8 608.8 374 597.4 368.3 585.9 365.4 571.6 365.4 557.3 365.4 522.9 379.8 494.3 405.5 477.1 431.3 457.1 471.4 448.5 522.9 448.5H571.6V428.4C571.6 411.2 565.9 399.8 557.3 391.2 545.8 382.6 531.5 376.9 511.5 376.9 494.3 376.9 482.8 379.7 474.3 388.3 465.7 396.9 462.8 405.5 462.8 417H376.9C376.9 402.6 379.8 388.3 385.5 376.9 391.2 365.4 399.8 354 414.1 342.5 425.6 333.9 439.9 325.3 457.1 319.6 474.3 313.9 494.3 311 517.2 311 537.3 311 554.4 313.9 571.6 319.6 588.8 325.3 603.1 331 617.4 342.5 628.9 351.1 640.3 365.4 646.1 379.7 651.8 394 657.5 411.2 657.5 431.3V574.5C657.5 591.6 657.5 606 660.4 617.4 663.3 628.9 666.1 640.3 669 646V651.8H580.2ZM497.2 591.6C505.8 591.6 514.3 591.6 520.1 588.8 528.7 585.9 534.4 583 540.1 580.2 545.8 577.3 551.6 574.5 554.4 568.7 557.3 565.9 563 560.1 565.9 557.3V500H522.9C508.6 500 497.2 500 488.6 502.9 480 505.7 471.4 508.6 465.7 514.3 459.9 520 454.2 522.9 451.3 531.5 448.5 537.2 448.5 545.8 448.5 551.5 448.5 563 451.3 571.6 459.9 580.2 468.5 588.8 482.8 591.6 497.2 591.6ZM500 114.8C287.3 114.8 114.8 287.3 114.8 500 114.8 712.7 287.3 885.2 500 885.2 712.7 885.2 885.2 712.7 885.2 500 885.2 287.3 712.7 114.8 500 114.8ZM43.3 500C43.3 247.7 247.7 43.3 500 43.3 752.2 43.3 956.7 247.7 956.7 500 956.7 752.2 752.2 956.7 500 956.7 247.7 956.7 43.3 752.2 43.3 500ZM508.6 654.6C516.2 652.7 521.3 650.8 526.4 648.9 529 648 531.5 647 534.4 646 535.7 645.4 537.2 644.7 538.8 644 541.1 643 543.5 641.9 545.8 640.7 547.6 639.7 549.4 638.7 551 637.5 552.2 636.6 553.4 635.6 554.4 634.6 557.3 631.7 560.1 629.6 563 627.4 565.9 625.3 568.7 623.1 571.6 620.3 571.6 623.1 572.3 626 573 628.9 573.8 631.7 574.5 634.6 574.5 637.5 575.7 640 576.4 642.5 577.1 644.7 577.7 647.2 578.3 649.3 579.5 650.9 579.7 651.2 579.9 651.5 580.2 651.8H669V646C666.6 641.3 664.2 632.5 661.8 623.1 661.3 621.2 660.9 619.3 660.4 617.4 657.5 606 657.5 591.6 657.5 574.5V431.3C657.5 411.2 651.8 394 646.1 379.7 640.3 365.4 628.9 351.1 617.4 342.5 603.1 331 588.8 325.3 571.6 319.6 554.4 313.9 537.2 311 517.2 311 494.3 311 474.2 313.9 457.1 319.6 439.9 325.3 425.6 333.9 414.1 342.5 399.8 354 391.2 365.4 385.5 376.9 383.7 380.4 382.2 384.3 381 388.3 378.2 397.2 376.9 407.1 376.9 417H462.8C462.8 405.5 465.6 396.9 474.2 388.3 482.8 379.7 494.3 376.9 511.5 376.9 531.5 376.9 545.8 382.6 557.3 391.2 564.4 398.3 569.5 407.3 571.1 419.8 571.4 422.5 571.6 425.4 571.6 428.4V448.5H522.9C471.4 448.5 431.3 457 405.5 477.1 379.7 494.3 365.4 522.9 365.4 557.3 365.4 571.6 368.3 585.9 374 597.4 379.7 608.8 385.5 620.3 396.9 628.9 408.4 637.5 419.8 643.2 434.2 648.9 448.5 654.6 462.8 657.5 480 657.5 488.6 657.5 500 657.5 508.6 654.6ZM439.8 388.3C443.2 380.6 448.1 374 454 368.1 470.7 351.4 491.7 348.2 511.5 348.2 537.7 348.2 558.1 356 574.5 368.3L576.1 369.5 577.5 370.9C591.6 385 600.2 403.7 600.2 428.4V477.1H594.5V556.9L600.2 551.1V619.5C600.3 619.8 600.5 620.6 600.8 621.9 600.9 622.1 600.9 622.2 600.9 622.4 601 622.6 601.1 622.9 601.1 623.1H632.3C628.9 608.5 628.9 591.6 628.9 576.6 628.9 575.9 628.9 575.2 628.9 574.5V431.3C628.9 416.7 624.7 403.6 619.5 390.4 615.8 381.2 607.7 371 600.2 365.4L599.9 365.1 599.5 364.9C589.2 356.6 578.8 352.2 562.5 346.8 548.4 342 534.2 339.6 517.2 339.6 496.6 339.6 479.7 342.2 466.1 346.8 452.7 351.2 441.2 358 431.6 365.1 421.4 373.4 415.6 381.1 411.8 388.3H439.8ZM554.4 568.7L565.9 557.3V500H522.9C508.6 500 497.1 500 488.6 502.9 480 505.7 471.4 508.6 465.6 514.3 464.2 515.8 462.7 517.1 461.3 518.3 457.2 521.9 453.5 525.1 451.3 531.5 448.5 537.2 448.5 545.8 448.5 551.5 448.5 563 451.3 571.6 459.9 580.2 468.5 588.8 482.8 591.6 497.1 591.6 505.7 591.6 514.3 591.6 520.1 588.8 528.6 585.9 534.4 583 540.1 580.2 545.8 577.3 551.6 574.5 554.4 568.7ZM530.6 615.4C523.8 618.4 517 619.4 512.3 619.8 507 620.3 501.6 620.3 497.6 620.3L497.1 620.3C481 620.3 456.7 617.4 439.7 600.4 433 593.8 427.7 586.2 424.3 577.2 420.9 568.4 419.8 559.7 419.8 551.5L419.8 551.2C419.8 548.5 419.8 543.7 420.3 538.7 420.8 534.2 421.8 527.5 424.8 520.7 428 512.1 432.6 506.1 437.2 501.6 439.1 499.6 441.1 497.9 442.3 496.8 442.4 496.8 442.5 496.7 442.6 496.6 444 495.4 444.8 494.7 445.4 494.1 450 489.5 455.3 486 460.4 483.3 444.3 487.2 432 492.8 423.1 499.7L422.3 500.3 421.4 500.9C404.6 512.1 394.1 531.3 394.1 557.3 394.1 568.1 396.3 577.9 399.6 584.6 405.7 596.7 408.8 602 414.1 606 422.9 612.5 431.8 617.1 444.8 622.3 455.7 626.7 466.3 628.9 480 628.9 489.9 628.9 496.3 628.6 499.6 627.5L500.6 627.1 501.7 626.9C507.9 625.3 510.8 624.2 514.7 622.7 517 621.8 519.7 620.8 523.5 619.5 524.8 618.9 526.1 618.3 527 617.9 527.2 617.8 527.3 617.8 527.4 617.7 529.1 616.9 530.4 616.4 531.6 615.8 533.6 614.8 534.2 614.3 534.3 614.2M530.6 615.4C532 615 533.3 614.5 534.5 614L530.6 615.4Z", + "path": "M684.8 440.3H676.5C669.6 440.3 664 434.9 664 428.2V419.8H588.5C586 419.8 584.1 421.7 584.1 424.1 584.1 426.5 586 428.4 588.5 428.4H641.5A168 168 0 0 1 661.1 507.2C661.1 602.9 580.8 680.5 481.9 680.5 382.9 680.5 302.7 602.9 302.7 507.2 302.7 411.9 382.1 334.6 480.4 333.9L481.9 333.9H664V331.6C664 325 669.6 319.5 676.5 319.5H684.8C691.7 319.5 697.3 325 697.3 331.6V428.2C697.3 434.9 691.7 440.3 684.8 440.3ZM481.9 565.9C515.4 565.9 542.6 539.6 542.6 507.2 542.6 474.7 515.4 448.4 481.9 448.4 448.3 448.4 421.2 474.7 421.2 507.2 421.2 539.6 448.3 565.9 481.9 565.9ZM500 69.6C262.7 69.6 69.6 262.7 69.6 500 69.6 737.3 262.7 930.4 500 930.4 737.3 930.4 930.5 737.3 930.5 500 930.5 262.7 737.3 69.6 500 69.6ZM500 138C700.4 138 862 299.7 862 500 862 700.3 700.4 862 500 862 299.7 862 138 700.3 138 500 138 299.7 299.7 138 500 138Z", "width": 1000 }, "search": [ - "arweave-coin" + "turbo-coin-(1)-(2)" ] }, { - "uid": "28fb2839a66640875ede1bd404024968", - "css": "license-1", - "code": 59471, + "uid": "0981706192e9c5d40d7f7f3ee748901a", + "css": "arweave", + "code": 59480, "src": "custom_icons", "selected": true, "svg": { - "path": "M500 125C361.9 125 250 236.9 250 375 250 452.3 285 521.3 340.1 567.2 383.5 603.3 439.2 625 500 625 565.2 625 624.6 600.1 669.1 559.1 718.9 513.4 750 447.9 750 375 750 236.9 638.1 125 500 125ZM166.7 375C166.7 190.9 315.9 41.7 500 41.7 684.1 41.7 833.3 190.9 833.3 375 833.3 463.3 799 543.6 743 603.2L811.5 907.5C815.2 923.9 808.7 940.8 795 950.6 781.4 960.3 763.3 960.9 749 952.2L734.1 943C591.9 855.5 411.9 858.8 273.1 951.3 259.1 960.7 240.8 960.7 226.8 951.3 212.8 941.9 205.8 925 209.1 908.5L268 614.3C205.5 553.8 166.7 468.9 166.7 375ZM342.1 668.6L308.3 837.8C436.2 782.7 581.7 782.3 710.2 837.1L670.7 661.4C620.8 691.2 562.4 708.3 500 708.3 442.9 708.3 389.1 694 342.1 668.6Z", + "path": "M500 114.8C287.3 114.8 114.8 287.3 114.8 500S287.3 885.2 500 885.2C712.7 885.2 885.2 712.7 885.2 500S712.7 114.8 500 114.8ZM43.3 500C43.3 247.8 247.7 43.3 500 43.3S956.8 247.8 956.8 500C956.8 752.3 752.3 956.8 500 956.8S43.3 752.3 43.3 500ZM580.2 651.8C577.3 648.9 577.3 643.2 574.5 637.5 574.5 631.8 571.6 626 571.6 620.3 565.9 626 560.2 628.9 554.4 634.6S540.1 643.2 534.4 646.1C525.8 648.9 520.1 651.8 508.6 654.7 500 657.5 488.6 657.5 480 657.5 462.8 657.5 448.5 654.7 434.2 648.9S408.4 637.5 397 628.9C385.5 620.3 379.8 608.9 374.1 597.4S365.5 571.6 365.5 557.3C365.5 522.9 379.8 494.3 405.6 477.1 431.3 457.1 471.4 448.5 523 448.5H571.7V428.5C571.7 411.3 565.9 399.8 557.3 391.3 545.9 382.7 531.6 376.9 511.5 376.9 494.3 376.9 482.9 379.8 474.3 388.4S462.8 405.6 462.8 417H376.9C376.9 402.7 379.8 388.4 385.5 376.9S399.8 354 414.2 342.6C425.6 334 439.9 325.4 457.1 319.7S494.3 311.1 517.3 311.1C537.3 311.1 554.5 313.9 571.7 319.7S603.2 331.1 617.5 342.6C628.9 351.2 640.4 365.5 646.1 379.8S657.6 411.3 657.6 431.3V574.5C657.6 591.7 657.6 606 660.4 617.5S666.2 640.4 669 646.1V651.8H580.2ZM497.2 591.6C505.8 591.6 514.3 591.6 520.1 588.8 528.7 585.9 534.4 583 540.1 580.2S551.6 574.4 554.4 568.7C557.3 565.8 563 560.1 565.9 557.2V499.9H522.9C508.6 499.9 497.1 499.9 488.5 502.8S471.3 508.5 465.6 514.3C459.9 520 454.2 522.9 451.3 531.5 448.4 537.2 448.4 545.8 448.4 551.5 448.4 563 451.3 571.5 459.9 580.1S482.8 591.6 497.1 591.6ZM508.6 654.6C500 657.5 488.6 657.5 480 657.5 462.8 657.5 448.5 654.6 434.2 648.9S408.4 637.4 397 628.9C385.5 620.3 379.8 608.8 374.1 597.4S365.5 571.6 365.5 557.3C365.5 522.9 379.8 494.3 405.6 477.1 431.3 457.1 471.4 448.5 523 448.5H571.7V428.4C571.7 425.4 571.5 422.5 571.1 419.8 569.5 407.3 564.4 398.3 557.3 391.2 545.9 382.6 531.6 376.9 511.5 376.9 494.3 376.9 482.9 379.8 474.3 388.4S462.8 405.6 462.8 417H376.9C376.9 407.2 378.3 397.3 381 388.4 382.2 384.3 383.8 380.5 385.5 376.9 391.3 365.4 399.8 354 414.2 342.5 425.6 333.9 439.9 325.3 457.1 319.6S494.3 311 517.3 311C537.3 311 554.5 313.9 571.7 319.6S603.2 331.1 617.5 342.5C628.9 351.1 640.4 365.4 646.1 379.8S657.6 411.3 657.6 431.3V574.5C657.6 591.7 657.6 606 660.4 617.4 660.9 619.3 661.4 621.3 661.9 623.2 664.3 632.6 666.7 641.3 669 646.1V651.8H580.2C580 651.5 579.8 651.2 579.5 650.9 578.4 649.3 577.8 647.2 577.1 644.8 576.5 642.5 575.8 640 574.5 637.5 574.5 634.6 573.8 631.8 573.1 628.9S571.7 623.2 571.7 620.3C568.8 623.2 565.9 625.3 563.1 627.4S557.3 631.7 554.5 634.6C553.4 635.6 552.3 636.6 551.1 637.5 549.4 638.7 547.7 639.7 545.9 640.7 543.5 641.9 541.1 643 538.9 644 537.3 644.7 535.8 645.4 534.4 646 531.5 647 529 647.9 526.4 648.9 521.3 650.8 516.3 652.7 508.6 654.6ZM439.8 388.3C443.3 380.6 448.1 374 454 368.1 470.7 351.4 491.7 348.2 511.5 348.2 537.7 348.2 558.1 356 574.5 368.3L576.1 369.5 577.5 370.9C591.6 384.9 600.3 403.7 600.3 428.4V477.1H594.5V556.8L600.3 551.1V619.5C600.3 619.8 600.5 620.5 600.8 621.9 600.8 622.1 600.9 622.2 600.9 622.4 601 622.6 601.1 622.9 601.1 623.1H632.3C628.9 608.5 628.9 591.6 628.9 576.6 628.9 575.8 628.9 575.2 628.9 574.4V431.2C628.9 416.7 624.8 403.5 619.5 390.3 615.8 381.2 607.7 371 600.3 365.4L599.9 365.1 599.6 364.8C589.3 356.6 578.8 352.1 562.6 346.7 548.4 342 534.3 339.6 517.3 339.6 496.7 339.6 479.8 342.2 466.2 346.7 452.8 351.2 441.3 358 431.7 365.1 421.4 373.4 415.6 381.1 411.8 388.3H439.8ZM554.4 568.7L565.9 557.3V500H522.9C508.6 500 497.2 500 488.6 502.8S471.4 508.6 465.7 514.3C464.2 515.8 462.7 517.1 461.3 518.3 457.2 521.9 453.5 525.1 451.3 531.5 448.5 537.2 448.5 545.8 448.5 551.5 448.5 563 451.3 571.5 459.9 580.1S482.8 591.6 497.2 591.6C505.8 591.6 514.3 591.6 520.1 588.7 528.7 585.8 534.4 583 540.1 580.1S551.6 574.4 554.4 568.7ZM530.7 615.4C523.8 618.4 517.1 619.3 512.3 619.8 507 620.3 501.6 620.3 497.7 620.3H497.2C481 620.3 456.7 617.4 439.7 600.4 433 593.8 427.7 586.2 424.3 577.2 420.8 568.3 419.8 559.6 419.8 551.5V551.2C419.8 548.5 419.8 543.7 420.3 538.7 420.8 534.2 421.8 527.5 424.8 520.7 428 512.1 432.7 506.1 437.2 501.6 439.1 499.6 441.1 497.9 442.3 496.8 442.4 496.7 442.5 496.7 442.6 496.6 444 495.3 444.8 494.7 445.4 494 450 489.4 455.3 485.9 460.4 483.2 444.3 487.1 432 492.7 423.1 499.7L422.3 500.3 421.4 500.9C404.6 512.1 394.1 531.2 394.1 557.2 394.1 568.1 396.3 577.9 399.7 584.5 405.7 596.6 408.8 602 414.1 605.9 422.9 612.5 431.8 617.1 444.8 622.3 455.7 626.7 466.4 628.8 480 628.8 489.9 628.8 496.3 628.6 499.6 627.4L500.6 627.1 501.7 626.8C507.9 625.2 510.8 624.2 514.7 622.7 517 621.8 519.7 620.8 523.6 619.4 524.8 618.8 526.1 618.3 527.1 617.8 527.2 617.8 527.3 617.7 527.4 617.7 529.2 616.9 530.4 616.3 531.6 615.7 533.6 614.8 534.2 614.3 534.3 614.2ZM530.7 615.4C532 614.9 533.3 614.5 534.5 614Z", "width": 1000 }, "search": [ - "license" + "arweave" ] } ] diff --git a/packages/ardrive_ui/lib/src/styles/icons/ar_drive_icons_icons.dart b/packages/ardrive_ui/lib/src/styles/icons/ar_drive_icons_icons.dart index 9ea066fd02..321ec3466b 100644 --- a/packages/ardrive_ui/lib/src/styles/icons/ar_drive_icons_icons.dart +++ b/packages/ardrive_ui/lib/src/styles/icons/ar_drive_icons_icons.dart @@ -1,6 +1,4 @@ -// ignore_for_file: constant_identifier_names - -/// Flutter icons ArDriveIcons +/// Flutter icons ArDriveIconsf /// Copyright (C) 2024 by original authors @ fluttericon.com, fontello.com /// This font was generated by FlutterIcon.com, which is derived from Fontello. /// @@ -16,6 +14,7 @@ /// /// library; +// ignore_for_file: constant_identifier_names import 'package:flutter/widgets.dart'; @@ -195,10 +194,10 @@ class ArDriveIconsData { IconData(0xe855, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData chevron_down = IconData(0xe856, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData arweave = + IconData(0xe858, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData turbo_coin = - IconData(0xe85a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData arweave_coin = - IconData(0xe85b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + IconData(0xe859, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData arrow_download = IconData(0xe880, fontFamily: _kFontFam, fontPackage: _kFontPkg); } diff --git a/packages/ardrive_ui/lib/src/styles/icons/icons.dart b/packages/ardrive_ui/lib/src/styles/icons/icons.dart index f5c239d651..9fec9dfb2b 100644 --- a/packages/ardrive_ui/lib/src/styles/icons/icons.dart +++ b/packages/ardrive_ui/lib/src/styles/icons/icons.dart @@ -492,7 +492,7 @@ class ArDriveIcons { ); static ArDriveIcon arweaveCoin({double? size, Color? color}) => ArDriveIcon( - icon: ArDriveIconsData.arweave_coin, + icon: ArDriveIconsData.arweave, size: size, color: color, ); diff --git a/packages/ardrive_ui/test/src/components/check_box_test.dart b/packages/ardrive_ui/test/src/components/check_box_test.dart index 69548cbfbe..1e4d17fe61 100644 --- a/packages/ardrive_ui/test/src/components/check_box_test.dart +++ b/packages/ardrive_ui/test/src/components/check_box_test.dart @@ -115,6 +115,7 @@ void main() { const checkbox = ArDriveCheckBox( title: 'Title', key: Key('checkbox'), + useNewIcons: false, ); await tester.pumpWidget( @@ -154,6 +155,7 @@ void main() { title: 'Title', key: Key('checkbox'), isDisabled: true, + useNewIcons: false, ); await tester.pumpWidget( diff --git a/test/blocs/upload_cubit_test.dart b/test/blocs/upload_cubit_test.dart index caa101ff6c..34a8fb2191 100644 --- a/test/blocs/upload_cubit_test.dart +++ b/test/blocs/upload_cubit_test.dart @@ -352,13 +352,13 @@ void main() { 'should found the conflicting files correctly and set isAllFilesConflicting to true' ' when all files are conflicting', build: () { - return getUploadCubitInstanceWith(tAllConflictingFiles); - }, - act: (cubit) async { when(() => mockArDriveAuth.getWalletAddress()) .thenAnswer((invocation) => Future.value(tWalletAddress)); when(() => mockArnsRepository.getAntRecordsForWallet(tWalletAddress!)) .thenAnswer((invocation) => Future.value([])); + return getUploadCubitInstanceWith(tAllConflictingFiles); + }, + act: (cubit) async { await cubit.startUploadPreparation(); await cubit.checkConflictingFiles(); }, From ce9ded0e1167828cb0b6bc5b09991d9acf48eec2 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho <32248947+thiagocarvalhodev@users.noreply.github.com> Date: Fri, 27 Sep 2024 11:06:59 -0300 Subject: [PATCH 5/6] Update payment_method_selector_widget.dart --- lib/components/payment_method_selector_widget.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/components/payment_method_selector_widget.dart b/lib/components/payment_method_selector_widget.dart index 2edc2a7f8f..829d301072 100644 --- a/lib/components/payment_method_selector_widget.dart +++ b/lib/components/payment_method_selector_widget.dart @@ -87,6 +87,7 @@ class _PaymentMethodSelectorState extends State { } else { return ArDriveIcons.turboCoin( size: 28, + color: ArDriveTheme.of(context).themeData.colorTokens.containerRed, ); } } From 95ee158abf1ad6e018f804780bd0637f1b39b3be Mon Sep 17 00:00:00 2001 From: Thiago Carvalho <32248947+thiagocarvalhodev@users.noreply.github.com> Date: Wed, 2 Oct 2024 10:47:37 -0300 Subject: [PATCH 6/6] Update ar_drive_icons_icons.dart --- .../ardrive_ui/lib/src/styles/icons/ar_drive_icons_icons.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ardrive_ui/lib/src/styles/icons/ar_drive_icons_icons.dart b/packages/ardrive_ui/lib/src/styles/icons/ar_drive_icons_icons.dart index 321ec3466b..8ff099fb30 100644 --- a/packages/ardrive_ui/lib/src/styles/icons/ar_drive_icons_icons.dart +++ b/packages/ardrive_ui/lib/src/styles/icons/ar_drive_icons_icons.dart @@ -1,4 +1,4 @@ -/// Flutter icons ArDriveIconsf +/// Flutter icons ArDriveIcons /// Copyright (C) 2024 by original authors @ fluttericon.com, fontello.com /// This font was generated by FlutterIcon.com, which is derived from Fontello. ///