diff --git a/lib/app/features/tokenized_communities/views/pages/tokenized_community_page.dart b/lib/app/features/tokenized_communities/views/pages/tokenized_community_page.dart index 998c56c33d..9d37dc4280 100644 --- a/lib/app/features/tokenized_communities/views/pages/tokenized_community_page.dart +++ b/lib/app/features/tokenized_communities/views/pages/tokenized_community_page.dart @@ -15,6 +15,7 @@ import 'package:ion/app/features/components/bookmarks/bookmark_button.dart'; import 'package:ion/app/features/feed/views/components/community_token_live/components/feed_content_token.dart'; import 'package:ion/app/features/feed/views/components/community_token_live/components/feed_profile_token.dart'; import 'package:ion/app/features/feed/views/components/community_token_live/components/feed_twitter_token.dart'; +import 'package:ion/app/features/tokenized_communities/models/entities/community_token_definition.f.dart'; import 'package:ion/app/features/tokenized_communities/models/trading_stats_formatted.dart'; import 'package:ion/app/features/tokenized_communities/providers/community_token_definition_provider.r.dart'; import 'package:ion/app/features/tokenized_communities/providers/token_latest_trades_provider.r.dart'; @@ -83,6 +84,10 @@ class TokenizedCommunityPage extends HookConsumerWidget { final tokenDefinition = ref .watch(tokenDefinitionForExternalAddressProvider(externalAddress: externalAddress)) .valueOrNull; + final tradeEventReference = switch (tokenDefinition?.data) { + CommunityTokenDefinitionIon(:final eventReference) => eventReference, + _ => null, + }; final tokenType = ref.watch(tokenTypeForExternalAddressProvider(externalAddress)).valueOrNull; final activeTab = useState(TokenizedCommunityTabType.chart); final isCommentInputFocused = useMemoized(() => ValueNotifier(false), []); @@ -200,9 +205,9 @@ class TokenizedCommunityPage extends HookConsumerWidget { builder: (context, isFocused, _) { return isFocused ? const SizedBox.shrink() - : FloatingTradeIsland( - externalAddress: externalAddress, - ); + : tradeEventReference != null + ? FloatingTradeIsland(eventReference: tradeEventReference) + : FloatingTradeIsland(externalAddress: externalAddress); }, ), headerActionsBuilder: (OverlayMenuCloseSignal menuCloseSignal) => [ diff --git a/lib/app/features/tokenized_communities/views/trade_community_token_dialog.dart b/lib/app/features/tokenized_communities/views/trade_community_token_dialog.dart index d17b1a23ce..8038a2fc0c 100644 --- a/lib/app/features/tokenized_communities/views/trade_community_token_dialog.dart +++ b/lib/app/features/tokenized_communities/views/trade_community_token_dialog.dart @@ -18,6 +18,7 @@ import 'package:ion/app/features/ion_connect/model/event_reference.f.dart'; import 'package:ion/app/features/ion_connect/providers/ion_connect_entity_provider.r.dart'; import 'package:ion/app/features/tokenized_communities/enums/community_token_trade_mode.dart'; import 'package:ion/app/features/tokenized_communities/providers/community_token_trade_notifier_provider.r.dart'; +import 'package:ion/app/features/tokenized_communities/providers/external_address_type_provider.r.dart'; import 'package:ion/app/features/tokenized_communities/providers/trade_community_token_controller_provider.r.dart'; import 'package:ion/app/features/tokenized_communities/providers/trade_infrastructure_providers.r.dart'; import 'package:ion/app/features/tokenized_communities/utils/constants.dart'; @@ -60,12 +61,12 @@ class TradeCommunityTokenDialog extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final resolvedExternalAddress = externalAddress ?? eventReference!.toString(); - final resolvedExternalAddressType = externalAddress != null - ? const ExternalAddressType.x() - : ref + final resolvedExternalAddressType = eventReference != null + ? ref .watch(ionConnectEntityProvider(eventReference: eventReference!)) .valueOrNull - ?.externalAddressType; + ?.externalAddressType + : ref.watch(externalAddressTypeProvider(externalAddress: externalAddress!)).valueOrNull; if (resolvedExternalAddressType == null) { return const SheetContent(body: SizedBox.shrink()); }