2020-02-10 19:53:32 +00:00
|
|
|
<template>
|
|
|
|
|
<router-link
|
2020-08-25 14:36:36 +00:00
|
|
|
@click.native="close"
|
2023-09-20 20:01:43 +00:00
|
|
|
:to="{ name: 'summoner', params: { region: player.region, name: player.name } }"
|
2020-02-10 19:53:32 +00:00
|
|
|
:title="player.name"
|
2020-08-23 21:43:42 +00:00
|
|
|
:class="selected ? 'bg-blue-760' : 'bg-blue-900'"
|
|
|
|
|
class="flex items-center justify-between w-full px-4 py-3 mt-1 text-blue-200 rounded-md shadow-md cursor-pointer select-none bypass-click"
|
|
|
|
|
role="option"
|
2020-02-10 19:53:32 +00:00
|
|
|
>
|
2020-08-23 21:43:42 +00:00
|
|
|
<div class="flex items-center">
|
|
|
|
|
<svg v-if="favoritesList" class="w-5 h-5 text-yellow-400">
|
|
|
|
|
<use xlink:href="#star-outline" />
|
|
|
|
|
</svg>
|
|
|
|
|
<svg v-else class="w-5 h-5">
|
|
|
|
|
<use xlink:href="#time" />
|
|
|
|
|
</svg>
|
|
|
|
|
<div class="w-20">
|
|
|
|
|
<div
|
|
|
|
|
class="inline-flex px-2 py-1 ml-6 text-xs font-semibold text-white uppercase bg-blue-800 rounded"
|
2023-09-20 20:01:43 +00:00
|
|
|
>
|
|
|
|
|
{{ player.region }}
|
|
|
|
|
</div>
|
2020-08-23 21:43:42 +00:00
|
|
|
</div>
|
|
|
|
|
<div
|
2023-09-20 20:01:43 +00:00
|
|
|
:style="{
|
|
|
|
|
backgroundImage: `url('https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/profile-icons/${player.icon}.jpg')`,
|
|
|
|
|
}"
|
2020-08-23 21:43:42 +00:00
|
|
|
class="w-6 h-6 ml-2 bg-center bg-cover rounded-full"
|
|
|
|
|
></div>
|
|
|
|
|
<div class="ml-2 text-base">{{ player.name }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex items-center space-x-1">
|
|
|
|
|
<button
|
|
|
|
|
v-if="!favoritesList"
|
|
|
|
|
@click.prevent="favoriteClick"
|
|
|
|
|
class="flex items-center justify-center p-2 rounded-full hover:text-yellow-400 hover:bg-blue-700"
|
|
|
|
|
>
|
|
|
|
|
<svg class="w-4 h-4">
|
|
|
|
|
<use xlink:href="#star" />
|
|
|
|
|
</svg>
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
@click.prevent="closeClick"
|
|
|
|
|
class="p-2 rounded-full cursor-pointerhover:text-white hover:bg-blue-700"
|
|
|
|
|
>
|
|
|
|
|
<svg class="w-4 h-4">
|
|
|
|
|
<use xlink:href="#times" />
|
|
|
|
|
</svg>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
2020-02-10 19:53:32 +00:00
|
|
|
</router-link>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { mapActions } from 'vuex'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
props: {
|
|
|
|
|
favoritesList: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false,
|
|
|
|
|
},
|
|
|
|
|
player: {
|
|
|
|
|
type: Object,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
2020-08-23 21:43:42 +00:00
|
|
|
selected: {
|
|
|
|
|
type: Boolean,
|
2023-09-20 20:01:43 +00:00
|
|
|
default: false,
|
|
|
|
|
},
|
2020-02-10 19:53:32 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
methods: {
|
2020-08-25 14:36:36 +00:00
|
|
|
close() {
|
|
|
|
|
this.$emit('close')
|
|
|
|
|
},
|
2020-02-10 19:53:32 +00:00
|
|
|
closeClick() {
|
|
|
|
|
if (this.favoritesList) {
|
|
|
|
|
this.updateFavorite(this.player)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.removeRecentSearch(this.player)
|
|
|
|
|
},
|
|
|
|
|
favoriteClick() {
|
|
|
|
|
this.updateFavorite(this.player)
|
|
|
|
|
},
|
2023-09-20 20:01:43 +00:00
|
|
|
...mapActions('settings', ['removeRecentSearch', 'updateFavorite']),
|
2020-02-10 19:53:32 +00:00
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
</script>
|