Skip to content

Commit

Permalink
Merge pull request #2570 from ecyrb/ai-challenge-profile-link
Browse files Browse the repository at this point in the history
Add link to selected AI Player profile page in Challenge dialog.
  • Loading branch information
anoek authored Feb 12, 2024
2 parents b3eab58 + 7e01142 commit 53468a8
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions src/components/ChallengeModal/ChallengeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -949,19 +949,29 @@ export class ChallengeModal extends Modal<Events, ChallengeModalProperties, any>
<label className="control-label" htmlFor="engine">
{pgettext("Computer opponent", "AI Player")}
</label>
<div className="controls">
<select
id="challenge-ai"
value={this.state.conf.bot_id}
onChange={this.update_conf_bot_id}
required={true}
>
{bots_list().map((bot, idx) => (
<option key={idx} value={bot.id}>
{bot.username} ({rankString(getUserRating(bot).rank)})
</option>
))}
</select>
<div>
<div className="controls">
<select
id="challenge-ai"
value={this.state.conf.bot_id}
onChange={this.update_conf_bot_id}
required={true}
>
{bots_list().map((bot, idx) => (
<option key={idx} value={bot.id}>
{bot.username} ({rankString(getUserRating(bot).rank)})
</option>
))}
</select>
&nbsp;
<a
href={`/user/view/${this.state.conf.bot_id}`}
target="_blank"
title={_("Selected AI profile")}
>
<i className="fa fa-external-link" />
</a>
</div>
</div>
</div>
)}
Expand Down

0 comments on commit 53468a8

Please sign in to comment.