Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add back emoji button #1886

Merged
merged 1 commit into from
Feb 21, 2025
Merged
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
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';

import 'package:fluffychat/pangea/events/models/pangea_token_model.dart';
import 'package:fluffychat/pangea/toolbar/enums/activity_type_enum.dart';
import 'package:fluffychat/pangea/toolbar/widgets/practice_activity/word_zoom_activity_button.dart';

class EmojiPracticeButton extends StatelessWidget {
Expand All @@ -15,14 +16,22 @@ class EmojiPracticeButton extends StatelessWidget {
super.key,
});

bool get _shouldDoActivity => token.shouldDoActivity(
a: ActivityTypeEnum.emoji,
feature: null,
tag: null,
);

@override
Widget build(BuildContext context) {
final emoji = token.getEmoji();
return emoji != null
return _shouldDoActivity || emoji != null
? SizedBox(
width: 40,
child: WordZoomActivityButton(
icon: Text(emoji),
icon: emoji == null
? const Icon(Icons.add_reaction_outlined)
: Text(emoji),
isSelected: isSelected,
onPressed: onPressed,
),
Expand Down
Loading