From 44868c9fd3e4f624067b684f37f423475616cdc6 Mon Sep 17 00:00:00 2001 From: juebjueb Date: Sat, 28 Dec 2024 19:12:54 -0800 Subject: [PATCH] Add player profile links to the replay browser --- .../team_elements/team_elements.tsx | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/renderer/pages/replays/replay_browser/replay_file/team_elements/team_elements.tsx b/src/renderer/pages/replays/replay_browser/replay_file/team_elements/team_elements.tsx index cccf5f52e..6563e9228 100644 --- a/src/renderer/pages/replays/replay_browser/replay_file/team_elements/team_elements.tsx +++ b/src/renderer/pages/replays/replay_browser/replay_file/team_elements/team_elements.tsx @@ -1,8 +1,14 @@ import styled from "@emotion/styled"; +import OpenInNew from "@mui/icons-material/OpenInNew"; +import IconButton from "@mui/material/IconButton"; import React from "react"; +import { ExternalLink } from "@/components/external_link"; + import { PlayerBadge } from "./player_badge/player_badge"; +const SLIPPI_PROFILE_URL_PREFIX = "https://slippi.gg/user"; + const Outer = styled.div` display: flex; flex-direction: row; @@ -23,6 +29,23 @@ export const TeamElements = ({ teams }: TeamElementProps) => { teams.forEach((team, i) => { team.forEach((player) => { elements.push(); + + if (player.text.includes("#")) { + const profileUrl = `${SLIPPI_PROFILE_URL_PREFIX}/${player.text.split("#").join("-")}`; + elements.push( + e.stopPropagation()} + > + + , + ); + } }); // Add VS obj in between teams