diff --git a/client/src/components/Match/DetailedMatchTeam.vue b/client/src/components/Match/DetailedMatchTeam.vue index d8a7dab..869bde7 100644 --- a/client/src/components/Match/DetailedMatchTeam.vue +++ b/client/src/components/Match/DetailedMatchTeam.vue @@ -177,7 +177,7 @@
{{ player.name.replace('-', '#') }}{{ nameWithoutTagLine(player.name) }}
- {{ player.name.replace('-', '#') }} + {{ nameWithoutTagLine(player.name) }}
{{ player.champion.name }} @@ -309,6 +309,7 @@ import { mapActions, mapState } from 'vuex' import DotsLoader from '@/components/Common/DotsLoader.vue' import Tooltip from '@/components/Common/Tooltip.vue' import MatchItems from '@/components/Match/MatchItems.vue' +import { nameWithoutTagLine } from '@/helpers/functions' export default { components: { @@ -397,6 +398,7 @@ export default { this.displayRunes(player.perks) }, + nameWithoutTagLine, ...mapActions('cdragon', ['displayRunes']), }, } diff --git a/client/src/components/Match/Match.vue b/client/src/components/Match/Match.vue index 21110aa..27869ea 100644 --- a/client/src/components/Match/Match.vue +++ b/client/src/components/Match/Match.vue @@ -133,22 +133,22 @@ class="ml-4 flex items-center leading-none" > {{ ally.name.replace('-', '#') }} + >{{ nameWithoutTagLine(ally.name) }} +
- {{ ally.name.replace('-', '#') }} + {{ nameWithoutTagLine(ally.name) }}
{{ data.enemyTeam[index].name.replace('-', '#') }} + >{{ nameWithoutTagLine(data.enemyTeam[index].name) }} +
- {{ data.enemyTeam[index].name.replace('-', '#') }} + {{ nameWithoutTagLine(data.enemyTeam[index].name) }}
@@ -218,6 +218,7 @@ import Tooltip from '@/components/Common/Tooltip.vue' import DetailedMatch from '@/components/Match/DetailedMatch.vue' import MatchItems from '@/components/Match/MatchItems.vue' import Ripple from '@/components/Common/Ripple.vue' +import { nameWithoutTagLine } from '@/helpers/functions' export default { components: { @@ -260,12 +261,13 @@ export default { this.matchDetails(this.data.matchId) } }, - isSummonerProfile(account_id) { + isSummonerProfile(puuid) { return { - 'font-bold text-white': this.account.accountId === account_id, - 'text-blue-200': this.account.accountId !== account_id, + 'font-bold text-white': this.account.puuid === puuid, + 'text-blue-200': this.account.puuid !== puuid, } }, + nameWithoutTagLine, ...mapActions('detailedMatch', ['matchDetails']), }, } diff --git a/client/src/components/Summoner/Overview/SummonerMates.vue b/client/src/components/Summoner/Overview/SummonerMates.vue index 4a194c0..5bb3069 100644 --- a/client/src/components/Summoner/Overview/SummonerMates.vue +++ b/client/src/components/Summoner/Overview/SummonerMates.vue @@ -25,7 +25,7 @@ {{ mate.name.replace('-', '#') }}{{ nameWithoutTagLine(mate.name) }}
{{ mate.wins }} / {{ mate.losses }}
@@ -67,6 +67,7 @@ diff --git a/client/src/helpers/functions.js b/client/src/helpers/functions.js index 41ef6e2..bd48eba 100644 --- a/client/src/helpers/functions.js +++ b/client/src/helpers/functions.js @@ -52,3 +52,12 @@ export function createCDragonAssetUrl(iconPath) { const name = iconPath.split('/assets/')[1].toLowerCase() return `https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/${name}` } + +/** + * Remove tagLine from a name + * @param {String} name + */ +export function nameWithoutTagLine(name) { + const separator = name.lastIndexOf('-') + return separator === -1 ? name : name.slice(0, separator) +}