From d0b6e26e6ed7726fe085859e1c83152fbd1d4b9f Mon Sep 17 00:00:00 2001 From: AhsanAli13503 Date: Mon, 29 Apr 2024 13:00:03 +0500 Subject: [PATCH 1/4] feat: All Pylons tokens should instead display as USD --- easel/lib/utils/constants.dart | 4 ++-- .../pages/detailed_asset_view/owner_view.dart | 17 +++++++++++++++-- .../widgets/creation_collection_sheet.dart | 14 ++++++++++---- .../home/currency_screen/model/ibc_coins.dart | 6 ++++++ .../wallet_screen/widgets/currency_card.dart | 6 ++++-- .../widgets/latest_transactions.dart | 3 ++- .../services/data_stores/remote_data_store.dart | 11 +++++++++++ wallet/lib/utils/constants.dart | 4 ++-- 8 files changed, 52 insertions(+), 13 deletions(-) diff --git a/easel/lib/utils/constants.dart b/easel/lib/utils/constants.dart index 044dc6ce6a..20c52ee313 100644 --- a/easel/lib/utils/constants.dart +++ b/easel/lib/utils/constants.dart @@ -134,8 +134,8 @@ const kAgoricSymbol = 'urun'; const kJunoSymbol = 'ujunox'; const String kEthereumSymbol = "weth-wei"; -const kPylonText = 'Pylon'; -const kUSDText = 'USD'; +const kPylonText = 'IAP'; +const kUSDText = 'Stripe'; const kAtomText = 'Atom'; const kEurText = 'EEur'; const kAgoricText = 'Agoric'; diff --git a/wallet/lib/pages/detailed_asset_view/owner_view.dart b/wallet/lib/pages/detailed_asset_view/owner_view.dart index bb4ba5cb1e..c9cfb3d8c0 100644 --- a/wallet/lib/pages/detailed_asset_view/owner_view.dart +++ b/wallet/lib/pages/detailed_asset_view/owner_view.dart @@ -40,6 +40,8 @@ import '../../utils/failure/failure.dart'; import 'widgets/create_trade_bottom_sheet.dart'; import 'widgets/toggle_button.dart'; +import 'package:pylons_wallet/utils/constants.dart' as constants; + class OwnerView extends StatefulWidget { final NFT nft; @@ -286,6 +288,9 @@ class _CollapsedBottomMenuState extends State<_CollapsedBottomMenu> { final viewModel = context.read(); final ibcEnumCoins = viewModel.nft.ibcCoins; + /// this change will reflect only for upylon ibcCoins + final isPylon = ibcEnumCoins.getAbbrev() == constants.kPYLN_ABBREVATION; + return Padding( padding: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 16.w, top: 8.w), child: Column( @@ -328,7 +333,10 @@ class _CollapsedBottomMenuState extends State<_CollapsedBottomMenu> { children: [ if (viewModel.nft.type != NftType.TYPE_ITEM) Text( - "${ibcEnumCoins.getCoinWithProperDenomination(viewModel.nft.price)} ${ibcEnumCoins.getAbbrev()}", + /// message change request will reflect only if [isPylon] is [true] + isPylon? + "\$${ibcEnumCoins.pylnToCredit(viewModel.nft.ibcCoins.getCoinWithProperDenomination(viewModel.nft.price))} ${viewModel.nft.ibcCoins.getAbbrev()}": + "${ibcEnumCoins.getCoinWithProperDenomination(viewModel.nft.price)} ${ibcEnumCoins.getAbbrev()}", style: TextStyle(color: Colors.white, fontSize: 15.sp, fontWeight: FontWeight.bold), ) ], @@ -393,6 +401,8 @@ class __ExpandedBottomMenuState extends State<_ExpandedBottomMenu> { final viewModel = context.read(); final ibcEnumCoins = viewModel.nft.ibcCoins; + final isPylon = ibcEnumCoins.getAbbrev() == constants.kPYLN_ABBREVATION; + return Stack( key: const ValueKey(kOwnerViewBottomSheetKeyValue), children: [ @@ -656,9 +666,12 @@ class __ExpandedBottomMenuState extends State<_ExpandedBottomMenu> { children: [ if (viewModel.nft.type != NftType.TYPE_ITEM) ...[ Text( + /// message change request will reflect only if [isPylon] is [true] + isPylon? + "\$${ibcEnumCoins.pylnToCredit(viewModel.nft.ibcCoins.getCoinWithProperDenomination(viewModel.nft.price))} ${viewModel.nft.ibcCoins.getAbbrev()}": "${ibcEnumCoins.getCoinWithProperDenomination(viewModel.nft.price)} ${ibcEnumCoins.getAbbrev()}", style: TextStyle(color: Colors.white, fontSize: 15.sp, fontWeight: FontWeight.bold), - ), + ) ] ], ), diff --git a/wallet/lib/pages/home/collection_screen/widgets/creation_collection_sheet.dart b/wallet/lib/pages/home/collection_screen/widgets/creation_collection_sheet.dart index ad0f724cbd..f118f947a3 100644 --- a/wallet/lib/pages/home/collection_screen/widgets/creation_collection_sheet.dart +++ b/wallet/lib/pages/home/collection_screen/widgets/creation_collection_sheet.dart @@ -1,4 +1,3 @@ - import 'package:cached_network_image/cached_network_image.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; @@ -20,6 +19,7 @@ import '../../easel_section/no_easel_art_work.dart'; import '../collection_screen.dart'; import '../collection_view_model.dart'; import '../preview_nft_grid.dart'; +import 'package:pylons_wallet/utils/constants.dart' as constants; class CreationsCollection extends StatelessWidget { final OnNFTSelected onNFTSelected; @@ -58,14 +58,20 @@ class CreationsCollection extends StatelessWidget { childrenDelegate: SliverChildBuilderDelegate( (context, index) { final nft = viewModel.creations[index]; + + /// this change will reflect only for upylon ibcCoins + final isPylon = nft.ibcCoins.getAbbrev() == constants.kPYLN_ABBREVATION; + return ClipRRect( child: GestureDetector( onTap: () => onNFTSelected(nft), child: Banner( color: AppColors.kPriceTagColor, location: BannerLocation.topStart, - message: - "${nft.ibcCoins.getCoinWithProperDenomination(nft.price)} ${nft.ibcCoins.getAbbrev()}", + /// message change request will reflect only if [isPylon] is [true] + message: isPylon + ? "\$${nft.ibcCoins.pylnToCredit(nft.ibcCoins.getCoinWithProperDenomination(nft.price))} ${nft.ibcCoins.getAbbrev()}" + : "${nft.ibcCoins.pylnToCredit(nft.ibcCoins.getCoinWithProperDenomination(nft.price))} ${nft.ibcCoins.getAbbrev()}", child: PreviewNFTGrid( assetType: nft.assetType, on3dNFT: (BuildContext context) => Container( @@ -153,4 +159,4 @@ Widget _getAudioThumbnailFromUrl({required String thumbnailUrl}) { ); } -} \ No newline at end of file +} diff --git a/wallet/lib/pages/home/currency_screen/model/ibc_coins.dart b/wallet/lib/pages/home/currency_screen/model/ibc_coins.dart index 0044fe6762..67b17b2659 100644 --- a/wallet/lib/pages/home/currency_screen/model/ibc_coins.dart +++ b/wallet/lib/pages/home/currency_screen/model/ibc_coins.dart @@ -196,6 +196,12 @@ extension IBCCoinsDePar on IBCCoins { return "${(double.parse(amount) / kEthIntBase).toStringAsFixed(kCurrencyDecimalLength)} ${getAbbrev()}"; } } + + + String pylnToCredit(String amount) { + return( double.parse(amount)/10).toStringAsFixed(2); + } + } SizedBox getIconFromAsset(String ibcCoinIcon) => SizedBox( diff --git a/wallet/lib/pages/home/wallet_screen/widgets/currency_card.dart b/wallet/lib/pages/home/wallet_screen/widgets/currency_card.dart index 0fcf12d982..3738f312f3 100644 --- a/wallet/lib/pages/home/wallet_screen/widgets/currency_card.dart +++ b/wallet/lib/pages/home/wallet_screen/widgets/currency_card.dart @@ -16,6 +16,8 @@ import 'package:pylons_wallet/utils/constants.dart'; import 'package:pylons_wallet/utils/image_util.dart'; import '../../../../generated/locale_keys.g.dart'; +import 'package:pylons_wallet/utils/constants.dart' as constants; + class CurrencyBackgroundCard extends StatelessWidget { final bool isDefault; @@ -109,6 +111,7 @@ class CurrencyCard extends StatelessWidget { @override Widget build(BuildContext context) { List denomSpecificTxList = []; + if (isDefault) { denomSpecificTxList = context.read().getDenomSpecificTxList( defaultCurrency: currencyModel.currency, @@ -198,11 +201,10 @@ class CurrencyCard extends StatelessWidget { getHelpIcon(context), const Spacer(), Text( - currencyModel.amount, + "\$${currencyModel.ibcCoins.pylnToCredit(currencyModel.amount)}", style: kCurrencyStyle, ), SizedBox(width: 10.w), - Text(currencyModel.ibcCoins.getAbbrev(), style: kCurrencyStyle), ], ), Align( diff --git a/wallet/lib/pages/home/wallet_screen/widgets/latest_transactions.dart b/wallet/lib/pages/home/wallet_screen/widgets/latest_transactions.dart index 1049d575ef..b160b28304 100644 --- a/wallet/lib/pages/home/wallet_screen/widgets/latest_transactions.dart +++ b/wallet/lib/pages/home/wallet_screen/widgets/latest_transactions.dart @@ -8,6 +8,7 @@ import 'package:pylons_wallet/components/loading.dart'; import 'package:pylons_wallet/gen/assets.gen.dart'; import 'package:pylons_wallet/model/transaction.dart'; import 'package:pylons_wallet/modules/Pylonstech.pylons.pylons/module/client/pylons/recipe.pb.dart'; +import 'package:pylons_wallet/pages/home/currency_screen/model/ibc_coins.dart'; import 'package:pylons_wallet/providers/account_provider.dart'; import 'package:pylons_wallet/pylons_app.dart'; import 'package:pylons_wallet/stores/wallet_store.dart'; @@ -72,7 +73,7 @@ class LatestTransactions extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - "${getPrefix(txHistory) ? "" : "+"}${defaultCurrency.convertFromU(txHistory)} ${denomAbbr[defaultCurrency]}", + "${getPrefix(txHistory) ? "" : "+"}${denomAbbr[defaultCurrency] == kPYLN_ABBREVATION?"\$":""}${denomAbbr[defaultCurrency] == kPYLN_ABBREVATION?IBCCoins.upylon.pylnToCredit(defaultCurrency.convertFromU(txHistory)):defaultCurrency.convertFromU(txHistory)} ${denomAbbr[defaultCurrency]}", style: _headingTextStyle, ), if (defaultCurrency != kUSD) diff --git a/wallet/lib/services/data_stores/remote_data_store.dart b/wallet/lib/services/data_stores/remote_data_store.dart index 5156acbf11..619949f032 100644 --- a/wallet/lib/services/data_stores/remote_data_store.dart +++ b/wallet/lib/services/data_stores/remote_data_store.dart @@ -28,6 +28,7 @@ import 'package:pylons_wallet/model/wallet_creation_model.dart'; import 'package:pylons_wallet/modules/Pylonstech.pylons.pylons/module/export.dart' as pylons; import 'package:pylons_wallet/modules/cosmos.tx.v1beta1/module/export.dart' as cosmos_tx; import 'package:pylons_wallet/pages/detailed_asset_view/widgets/create_trade_bottom_sheet.dart'; +import 'package:pylons_wallet/pages/home/currency_screen/model/ibc_coins.dart'; import 'package:pylons_wallet/pages/home/currency_screen/model/ibc_trace_model.dart'; import 'package:pylons_wallet/services/third_party_services/analytics_helper.dart'; import 'package:pylons_wallet/services/third_party_services/firestore_helper.dart'; @@ -48,6 +49,7 @@ import '../../model/common.dart'; import '../../model/update_recipe_model.dart'; import '../../modules/Pylonstech.pylons.pylons/module/client/pylons/tx.pb.dart'; import '../../utils/types.dart'; +import 'package:pylons_wallet/utils/constants.dart' as constants; abstract class RemoteDataStore { /// This method is used to generate the stripe registration token @@ -1199,6 +1201,7 @@ class RemoteDataStoreImp implements RemoteDataStore { @override Future createDynamicLinkForRecipeNftShare({required String address, required NFT nft}) async { + final isPylon = nft.ibcCoins.getAbbrev() == constants.kPYLN_ABBREVATION; final dynamicLinkParams = DynamicLinkParameters( link: Uri.parse("$bigDipperBaseLink?recipe_id=${nft.recipeID}&cookbook_id=${nft.cookbookID}&address=$address"), uriPrefix: kDeepLink, @@ -1213,6 +1216,14 @@ class RemoteDataStoreImp implements RemoteDataStore { Uri.parse("$bigDipperBaseLink?recipe_id=${nft.recipeID}&cookbook_id=${nft.cookbookID}&address=$address"), ), navigationInfoParameters: const NavigationInfoParameters(forcedRedirectEnabled: true), + socialMetaTagParameters: SocialMetaTagParameters( + title: nft.name, + imageUrl: Uri.parse(nft.url), + description: '${nft.description} Price:${isPylon ? + "\$${nft.ibcCoins.pylnToCredit(nft.ibcCoins.getCoinWithProperDenomination(nft.price))}" + : "${nft.ibcCoins.getCoinWithProperDenomination(nft.price)} ${nft.ibcCoins.getAbbrev()}"}' + , + ) ); final link = await dynamicLinksGenerator.buildShortLink( diff --git a/wallet/lib/utils/constants.dart b/wallet/lib/utils/constants.dart index 70750f5a2f..d143ff4159 100644 --- a/wallet/lib/utils/constants.dart +++ b/wallet/lib/utils/constants.dart @@ -187,7 +187,7 @@ const String kAgoric = "Agoric"; const String kJuno = "Juno"; const String kNone = "None"; const String kEmoney = "eMoney Euro"; -const String kPylons = "Pylons"; +const String kPylons = "Pylons Credit"; const String kDollar = "U.S. Dollar"; const String kPoints = "Points"; const String kAtom = "ATOM"; @@ -217,7 +217,7 @@ List colorListForPracticeTest = [ /// Currency ABRR const String kEmoneyAbb = "EEUR"; const String kAGoricAbb = "run"; -const String kPYLN_ABBREVATION = 'PYLN'; +const String kPYLN_ABBREVATION = 'credit'; const String kStripeUSD_ABR = 'USD'; const String kAgoricAbr = "RUN"; const String kAtomAbr = "ATOM"; From 1cc665b545adda39eb4b58cd88a18d83b4c30deb Mon Sep 17 00:00:00 2001 From: AhsanRns Date: Tue, 30 Apr 2024 17:15:13 +0500 Subject: [PATCH 2/4] fix: free text when nft price is 0 --- .../pages/detailed_asset_view/owner_view.dart | 35 +++++++++---------- .../widgets/creation_collection_sheet.dart | 10 +++--- .../data_stores/remote_data_store.dart | 9 ++--- 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/wallet/lib/pages/detailed_asset_view/owner_view.dart b/wallet/lib/pages/detailed_asset_view/owner_view.dart index c9cfb3d8c0..192ec498c2 100644 --- a/wallet/lib/pages/detailed_asset_view/owner_view.dart +++ b/wallet/lib/pages/detailed_asset_view/owner_view.dart @@ -42,7 +42,6 @@ import 'widgets/create_trade_bottom_sheet.dart'; import 'widgets/toggle_button.dart'; import 'package:pylons_wallet/utils/constants.dart' as constants; - class OwnerView extends StatefulWidget { final NFT nft; @@ -289,7 +288,9 @@ class _CollapsedBottomMenuState extends State<_CollapsedBottomMenu> { final ibcEnumCoins = viewModel.nft.ibcCoins; /// this change will reflect only for upylon ibcCoins - final isPylon = ibcEnumCoins.getAbbrev() == constants.kPYLN_ABBREVATION; + final updatedText =ibcEnumCoins.getAbbrev() == constants.kPYLN_ABBREVATION + ? "\$${ibcEnumCoins.pylnToCredit(viewModel.nft.ibcCoins.getCoinWithProperDenomination(viewModel.nft.price))} ${viewModel.nft.ibcCoins.getAbbrev()}" + : "${ibcEnumCoins.getCoinWithProperDenomination(viewModel.nft.price)} ${ibcEnumCoins.getAbbrev()}"; return Padding( padding: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 16.w, top: 8.w), @@ -333,10 +334,9 @@ class _CollapsedBottomMenuState extends State<_CollapsedBottomMenu> { children: [ if (viewModel.nft.type != NftType.TYPE_ITEM) Text( - /// message change request will reflect only if [isPylon] is [true] - isPylon? - "\$${ibcEnumCoins.pylnToCredit(viewModel.nft.ibcCoins.getCoinWithProperDenomination(viewModel.nft.price))} ${viewModel.nft.ibcCoins.getAbbrev()}": - "${ibcEnumCoins.getCoinWithProperDenomination(viewModel.nft.price)} ${ibcEnumCoins.getAbbrev()}", + viewModel.nft.price == "0" + ? LocaleKeys.free.tr() + : updatedText, style: TextStyle(color: Colors.white, fontSize: 15.sp, fontWeight: FontWeight.bold), ) ], @@ -401,7 +401,10 @@ class __ExpandedBottomMenuState extends State<_ExpandedBottomMenu> { final viewModel = context.read(); final ibcEnumCoins = viewModel.nft.ibcCoins; - final isPylon = ibcEnumCoins.getAbbrev() == constants.kPYLN_ABBREVATION; + // this change will reflect only for upylon ibcCoins + final updatedText = ibcEnumCoins.getAbbrev() == constants.kPYLN_ABBREVATION + ? "\$${ibcEnumCoins.pylnToCredit(viewModel.nft.ibcCoins.getCoinWithProperDenomination(viewModel.nft.price))} ${viewModel.nft.ibcCoins.getAbbrev()}" + : "${ibcEnumCoins.getCoinWithProperDenomination(viewModel.nft.price)} ${ibcEnumCoins.getAbbrev()}"; return Stack( key: const ValueKey(kOwnerViewBottomSheetKeyValue), @@ -469,9 +472,7 @@ class __ExpandedBottomMenuState extends State<_ExpandedBottomMenu> { width: 10.w, ), Text( - viewModel.viewsCount == 1 - ? "${viewModel.viewsCount} ${LocaleKeys.view.tr()}" - : "${viewModel.viewsCount} ${LocaleKeys.views.tr()}", + viewModel.viewsCount == 1 ? "${viewModel.viewsCount} ${LocaleKeys.view.tr()}" : "${viewModel.viewsCount} ${LocaleKeys.views.tr()}", style: TextStyle(color: Colors.white, fontSize: 12.sp), ) ], @@ -592,9 +593,7 @@ class __ExpandedBottomMenuState extends State<_ExpandedBottomMenu> { recipeId: viewModel.nft.recipeID, ); }, - child: viewModel.isLiking - ? getLikingLoader() - : getLikeIcon(likedByMe: viewModel.likedByMe), + child: viewModel.isLiking ? getLikingLoader() : getLikeIcon(likedByMe: viewModel.likedByMe), ), ), SizedBox( @@ -629,8 +628,7 @@ class __ExpandedBottomMenuState extends State<_ExpandedBottomMenu> { if (viewModel.nft.assetType == AssetType.Image && Platform.isAndroid) GestureDetector( onTap: () { - final WallpaperScreen wallpaperScreen = - WallpaperScreen(nft: viewModel.nft.url, context: context); + final WallpaperScreen wallpaperScreen = WallpaperScreen(nft: viewModel.nft.url, context: context); wallpaperScreen.show(); }, child: SvgPicture.asset( @@ -666,10 +664,9 @@ class __ExpandedBottomMenuState extends State<_ExpandedBottomMenu> { children: [ if (viewModel.nft.type != NftType.TYPE_ITEM) ...[ Text( - /// message change request will reflect only if [isPylon] is [true] - isPylon? - "\$${ibcEnumCoins.pylnToCredit(viewModel.nft.ibcCoins.getCoinWithProperDenomination(viewModel.nft.price))} ${viewModel.nft.ibcCoins.getAbbrev()}": - "${ibcEnumCoins.getCoinWithProperDenomination(viewModel.nft.price)} ${ibcEnumCoins.getAbbrev()}", + viewModel.nft.price == "0" + ? LocaleKeys.free.tr() + : updatedText, style: TextStyle(color: Colors.white, fontSize: 15.sp, fontWeight: FontWeight.bold), ) ] diff --git a/wallet/lib/pages/home/collection_screen/widgets/creation_collection_sheet.dart b/wallet/lib/pages/home/collection_screen/widgets/creation_collection_sheet.dart index f118f947a3..243bba01f3 100644 --- a/wallet/lib/pages/home/collection_screen/widgets/creation_collection_sheet.dart +++ b/wallet/lib/pages/home/collection_screen/widgets/creation_collection_sheet.dart @@ -60,7 +60,10 @@ class CreationsCollection extends StatelessWidget { final nft = viewModel.creations[index]; /// this change will reflect only for upylon ibcCoins - final isPylon = nft.ibcCoins.getAbbrev() == constants.kPYLN_ABBREVATION; + /// message change request will reflect only if [isPylon] is [true] + final updatedText = nft.ibcCoins.getAbbrev() == constants.kPYLN_ABBREVATION? "\$${nft.ibcCoins.pylnToCredit(nft.ibcCoins.getCoinWithProperDenomination(nft.price))} ${nft.ibcCoins.getAbbrev()}" + : "${nft.ibcCoins.pylnToCredit(nft.ibcCoins.getCoinWithProperDenomination(nft.price))} ${nft.ibcCoins.getAbbrev()}"; + return ClipRRect( child: GestureDetector( @@ -68,10 +71,7 @@ class CreationsCollection extends StatelessWidget { child: Banner( color: AppColors.kPriceTagColor, location: BannerLocation.topStart, - /// message change request will reflect only if [isPylon] is [true] - message: isPylon - ? "\$${nft.ibcCoins.pylnToCredit(nft.ibcCoins.getCoinWithProperDenomination(nft.price))} ${nft.ibcCoins.getAbbrev()}" - : "${nft.ibcCoins.pylnToCredit(nft.ibcCoins.getCoinWithProperDenomination(nft.price))} ${nft.ibcCoins.getAbbrev()}", + message: nft.price == "0" ? LocaleKeys.free.tr() : updatedText, child: PreviewNFTGrid( assetType: nft.assetType, on3dNFT: (BuildContext context) => Container( diff --git a/wallet/lib/services/data_stores/remote_data_store.dart b/wallet/lib/services/data_stores/remote_data_store.dart index 619949f032..f11838fedb 100644 --- a/wallet/lib/services/data_stores/remote_data_store.dart +++ b/wallet/lib/services/data_stores/remote_data_store.dart @@ -1201,7 +1201,10 @@ class RemoteDataStoreImp implements RemoteDataStore { @override Future createDynamicLinkForRecipeNftShare({required String address, required NFT nft}) async { - final isPylon = nft.ibcCoins.getAbbrev() == constants.kPYLN_ABBREVATION; + final updateText = nft.ibcCoins.getAbbrev() == constants.kPYLN_ABBREVATION? + "\$${nft.ibcCoins.pylnToCredit(nft.ibcCoins.getCoinWithProperDenomination(nft.price))}" + : "${nft.ibcCoins.getCoinWithProperDenomination(nft.price)} ${nft.ibcCoins.getAbbrev()}"; + final dynamicLinkParams = DynamicLinkParameters( link: Uri.parse("$bigDipperBaseLink?recipe_id=${nft.recipeID}&cookbook_id=${nft.cookbookID}&address=$address"), uriPrefix: kDeepLink, @@ -1219,9 +1222,7 @@ class RemoteDataStoreImp implements RemoteDataStore { socialMetaTagParameters: SocialMetaTagParameters( title: nft.name, imageUrl: Uri.parse(nft.url), - description: '${nft.description} Price:${isPylon ? - "\$${nft.ibcCoins.pylnToCredit(nft.ibcCoins.getCoinWithProperDenomination(nft.price))}" - : "${nft.ibcCoins.getCoinWithProperDenomination(nft.price)} ${nft.ibcCoins.getAbbrev()}"}' + description: '${nft.description} Price:${nft.price == "0" ? LocaleKeys.free.tr() :updateText}' , ) ); From 2fe14a9f2f5b2b42e7a709db06c117ce4d73dbfb Mon Sep 17 00:00:00 2001 From: AhsanRns Date: Thu, 2 May 2024 09:55:26 +0500 Subject: [PATCH 3/4] fix: pr comments --- wallet/lib/pages/detailed_asset_view/owner_view.dart | 12 ++++++------ .../widgets/creation_collection_sheet.dart | 6 +++--- .../wallet_screen/widgets/latest_transactions.dart | 6 +++++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/wallet/lib/pages/detailed_asset_view/owner_view.dart b/wallet/lib/pages/detailed_asset_view/owner_view.dart index 192ec498c2..9cc4eb74b8 100644 --- a/wallet/lib/pages/detailed_asset_view/owner_view.dart +++ b/wallet/lib/pages/detailed_asset_view/owner_view.dart @@ -287,8 +287,8 @@ class _CollapsedBottomMenuState extends State<_CollapsedBottomMenu> { final viewModel = context.read(); final ibcEnumCoins = viewModel.nft.ibcCoins; - /// this change will reflect only for upylon ibcCoins - final updatedText =ibcEnumCoins.getAbbrev() == constants.kPYLN_ABBREVATION + /// This change will reflect only for upylon ibcCoins + final coinWithDenom =ibcEnumCoins.getAbbrev() == constants.kPYLN_ABBREVATION ? "\$${ibcEnumCoins.pylnToCredit(viewModel.nft.ibcCoins.getCoinWithProperDenomination(viewModel.nft.price))} ${viewModel.nft.ibcCoins.getAbbrev()}" : "${ibcEnumCoins.getCoinWithProperDenomination(viewModel.nft.price)} ${ibcEnumCoins.getAbbrev()}"; @@ -336,7 +336,7 @@ class _CollapsedBottomMenuState extends State<_CollapsedBottomMenu> { Text( viewModel.nft.price == "0" ? LocaleKeys.free.tr() - : updatedText, + : coinWithDenom, style: TextStyle(color: Colors.white, fontSize: 15.sp, fontWeight: FontWeight.bold), ) ], @@ -401,8 +401,8 @@ class __ExpandedBottomMenuState extends State<_ExpandedBottomMenu> { final viewModel = context.read(); final ibcEnumCoins = viewModel.nft.ibcCoins; - // this change will reflect only for upylon ibcCoins - final updatedText = ibcEnumCoins.getAbbrev() == constants.kPYLN_ABBREVATION + // This change will reflect only for upylon ibcCoins + final coinWithDenom = ibcEnumCoins.getAbbrev() == constants.kPYLN_ABBREVATION ? "\$${ibcEnumCoins.pylnToCredit(viewModel.nft.ibcCoins.getCoinWithProperDenomination(viewModel.nft.price))} ${viewModel.nft.ibcCoins.getAbbrev()}" : "${ibcEnumCoins.getCoinWithProperDenomination(viewModel.nft.price)} ${ibcEnumCoins.getAbbrev()}"; @@ -666,7 +666,7 @@ class __ExpandedBottomMenuState extends State<_ExpandedBottomMenu> { Text( viewModel.nft.price == "0" ? LocaleKeys.free.tr() - : updatedText, + : coinWithDenom, style: TextStyle(color: Colors.white, fontSize: 15.sp, fontWeight: FontWeight.bold), ) ] diff --git a/wallet/lib/pages/home/collection_screen/widgets/creation_collection_sheet.dart b/wallet/lib/pages/home/collection_screen/widgets/creation_collection_sheet.dart index 243bba01f3..ed5e3546a3 100644 --- a/wallet/lib/pages/home/collection_screen/widgets/creation_collection_sheet.dart +++ b/wallet/lib/pages/home/collection_screen/widgets/creation_collection_sheet.dart @@ -59,9 +59,9 @@ class CreationsCollection extends StatelessWidget { (context, index) { final nft = viewModel.creations[index]; - /// this change will reflect only for upylon ibcCoins + /// This change will reflect only for upylon ibcCoins /// message change request will reflect only if [isPylon] is [true] - final updatedText = nft.ibcCoins.getAbbrev() == constants.kPYLN_ABBREVATION? "\$${nft.ibcCoins.pylnToCredit(nft.ibcCoins.getCoinWithProperDenomination(nft.price))} ${nft.ibcCoins.getAbbrev()}" + final coinWithDenom = nft.ibcCoins.getAbbrev() == constants.kPYLN_ABBREVATION? "\$${nft.ibcCoins.pylnToCredit(nft.ibcCoins.getCoinWithProperDenomination(nft.price))} ${nft.ibcCoins.getAbbrev()}" : "${nft.ibcCoins.pylnToCredit(nft.ibcCoins.getCoinWithProperDenomination(nft.price))} ${nft.ibcCoins.getAbbrev()}"; @@ -71,7 +71,7 @@ class CreationsCollection extends StatelessWidget { child: Banner( color: AppColors.kPriceTagColor, location: BannerLocation.topStart, - message: nft.price == "0" ? LocaleKeys.free.tr() : updatedText, + message: nft.price == "0" ? LocaleKeys.free.tr() : coinWithDenom, child: PreviewNFTGrid( assetType: nft.assetType, on3dNFT: (BuildContext context) => Container( diff --git a/wallet/lib/pages/home/wallet_screen/widgets/latest_transactions.dart b/wallet/lib/pages/home/wallet_screen/widgets/latest_transactions.dart index b160b28304..413ad91a48 100644 --- a/wallet/lib/pages/home/wallet_screen/widgets/latest_transactions.dart +++ b/wallet/lib/pages/home/wallet_screen/widgets/latest_transactions.dart @@ -69,11 +69,15 @@ class LatestTransactions extends StatelessWidget { Column getAmountColumn({required TransactionHistory txHistory}) { if (txHistory.transactionTypeEnum == WalletHistoryTransactionType.NFTSELL || txHistory.transactionTypeEnum == WalletHistoryTransactionType.RECEIVE) { + + final checkIfKPYLNAbbr = denomAbbr[defaultCurrency] == kPYLN_ABBREVATION; + final historyWithDenom = "${getPrefix(txHistory) ? "" : "+"}${checkIfKPYLNAbbr?"\$${IBCCoins.upylon.pylnToCredit(defaultCurrency.convertFromU(txHistory))}":defaultCurrency.convertFromU(txHistory)} ${denomAbbr[defaultCurrency]}"; + return Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - "${getPrefix(txHistory) ? "" : "+"}${denomAbbr[defaultCurrency] == kPYLN_ABBREVATION?"\$":""}${denomAbbr[defaultCurrency] == kPYLN_ABBREVATION?IBCCoins.upylon.pylnToCredit(defaultCurrency.convertFromU(txHistory)):defaultCurrency.convertFromU(txHistory)} ${denomAbbr[defaultCurrency]}", + historyWithDenom, style: _headingTextStyle, ), if (defaultCurrency != kUSD) From ecc8db2a7639b913a70ad1cd07b3e85ecff4fb03 Mon Sep 17 00:00:00 2001 From: AhsanRns Date: Thu, 2 May 2024 09:55:52 +0500 Subject: [PATCH 4/4] fix: pr comments --- easel/lib/models/denom.dart | 4 ++-- easel/lib/screens/publish_screen.dart | 2 +- easel/lib/utils/constants.dart | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/easel/lib/models/denom.dart b/easel/lib/models/denom.dart index 17720e308f..653ac0059f 100644 --- a/easel/lib/models/denom.dart +++ b/easel/lib/models/denom.dart @@ -18,8 +18,8 @@ class Denom { } static List get availableDenoms => [ - Denom(name: kUSDText, symbol: kUsdSymbol, icon: PngUtils.kIconDenomUsd), - Denom(name: kPylonText, symbol: kPylonSymbol, icon: PngUtils.kIconDenomPylon), + Denom(name: kStripeText, symbol: kUsdSymbol, icon: PngUtils.kIconDenomUsd), + Denom(name: kIAPText, symbol: kPylonSymbol, icon: PngUtils.kIconDenomPylon), ]; TextInputFormatter getFormatter() { diff --git a/easel/lib/screens/publish_screen.dart b/easel/lib/screens/publish_screen.dart index 319ccea6d6..88f6072ff0 100644 --- a/easel/lib/screens/publish_screen.dart +++ b/easel/lib/screens/publish_screen.dart @@ -357,7 +357,7 @@ class _OwnerBottomDrawerState extends State { children: [ buildRow( title: LocaleKeys.currency.tr(), - subtitle: widget.nft.isFreeDrop == FreeDrop.yes.name ? kPylonText : getCurrency(), + subtitle: widget.nft.isFreeDrop == FreeDrop.yes.name ? kIAPText : getCurrency(), ), SizedBox(height: 5.h), buildRow(title: LocaleKeys.price.tr(), subtitle: getPriceSubtitle()), diff --git a/easel/lib/utils/constants.dart b/easel/lib/utils/constants.dart index 20c52ee313..d48f53618d 100644 --- a/easel/lib/utils/constants.dart +++ b/easel/lib/utils/constants.dart @@ -134,8 +134,8 @@ const kAgoricSymbol = 'urun'; const kJunoSymbol = 'ujunox'; const String kEthereumSymbol = "weth-wei"; -const kPylonText = 'IAP'; -const kUSDText = 'Stripe'; +const kIAPText = 'IAP'; +const kStripeText = 'Stripe'; const kAtomText = 'Atom'; const kEurText = 'EEur'; const kAgoricText = 'Agoric';