Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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<bool>(false), []);
Expand Down Expand Up @@ -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) => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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());
}
Expand Down