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

🏆 Add trophies #31

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

bal7hazar
Copy link

@bal7hazar bal7hazar commented Nov 12, 2024

To open the achievement page in your client, you just need to trigger this callback in a button where you want:

const handleTrophyClick = useCallback(() => {
  if (!connector?.controller) {
    console.error("Connector not initialized");
    return;
  }
  connector.controller.openProfile("achievements" as any); // Should be fixed with the c@cartridge/controller 0.5.0-alpha.9
}, [connector]);

Note: you can retrieve connector in the useAccount hook

const { connector } = useAccount();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant