Link to old user profiles on match page

This commit is contained in:
Kalle 2022-02-27 11:06:14 +02:00
parent 2b0bdf9d92
commit 6d82d99b18
4 changed files with 21 additions and 7 deletions

View File

@ -1,5 +1,6 @@
import type { LookingLoaderDataGroup } from "~/routes/play/looking";
import { layoutIcon } from "~/utils";
import { oldSendouInkUserProfile } from "~/utils/urls";
import { Avatar } from "../Avatar";
import { WeaponImage } from "../WeaponImage";
@ -37,7 +38,7 @@ function Contents({ members }: { members: LookingLoaderDataGroup["members"] }) {
return (
<div key={member.id} className="play-looking__member-card">
<a
href={`https://sendou.ink/u/${member.discordId}`}
href={oldSendouInkUserProfile({ discordId: member.discordId })}
target="_blank"
rel="noopener noreferrer"
className="play-looking__member-link"

View File

@ -39,6 +39,7 @@ import {
UserLean,
validate,
} from "~/utils";
import { oldSendouInkUserProfile } from "~/utils/urls";
export const links: LinksFunction = () => {
return [{ rel: "stylesheet", href: styles }];
@ -263,12 +264,20 @@ export default function LFGMatchPage() {
className="play-match__waves-section play-match__team-info"
>
{g.members.map((user) => (
<div key={user.id} className="play-match__player">
<Avatar user={user} />
<span className="play-match__player-name">
{user.discordName}
</span>
</div>
<a
href={oldSendouInkUserProfile({
discordId: user.discordId,
})}
target="_blank"
rel="noopener noreferrer"
>
<div key={user.id} className="play-match__player">
<Avatar user={user} />
<span className="play-match__player-name">
{user.discordName}
</span>
</div>
</a>
))}
{data.scores && (
<div

View File

@ -88,6 +88,7 @@
flex-direction: column;
align-items: center;
font-size: var(--fonts-xs);
color: var(--text);
}
.play-match__score {

3
app/utils/urls.ts Normal file
View File

@ -0,0 +1,3 @@
export function oldSendouInkUserProfile({ discordId }: { discordId: string }) {
return `https://sendou.ink/u/${discordId}`;
}