feat: Make player tags in the replay browser clickable #375
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello! I implemented a tiny feature whereby you can click a players name on the replay browser and it will open their profile on slippi.gg in your browser:
I picked this up after I saw it was a feature request in the discord channel
A couple things to note:
const [prefix, suffix] = text.split("#");
being non-null make a tag clickable. Essentially the click handler can undefined, which implicitly handles this case. If we think this is ugly I can try to make it more explicit.InternalPlayerBadge
doesn't render the tags led me to pass the click handler into it, but perhaps we should consider consolidating all of the logic into one component - not sure if there's some other prior motivation for separatingInternalPlayerBadge
from the exportedPlayerBadge
This is my first time contributing to this project, so I did my best to follow examples of other PRs I saw in the repo but please let me know if I'm not properly following any conventions here