feat: update layout to add season select

This commit is contained in:
Valentin Kaelin 2020-02-01 17:14:03 +01:00
parent d1b69aa577
commit 1f7bd5a853
10 changed files with 102 additions and 35 deletions

View file

@ -3,8 +3,8 @@
<Ripple
@click.native="displayDetails"
color="rgba(43, 108, 176, 0.7)"
:class="[data.result, showDetails ? 'rounded-t-lg' : 'rounded-lg']"
class="match relative mt-4 bg-blue-800 text-white text-base cursor-pointer hover:shadow-xl"
:class="[data.result, showDetails ? 'rounded-t-lg' : 'rounded-lg', {'mt-4': indexMatch !== 0 }]"
class="match relative bg-blue-800 text-white text-base cursor-pointer hover:shadow-xl"
>
<div class="relative flex flex-wrap px-5 py-3">
<div class="first w-4/12 text-left">
@ -169,6 +169,10 @@ export default {
type: Object,
required: true
},
indexMatch: {
type: Number,
default: -1,
}
},
data() {

View file

@ -0,0 +1,48 @@
<template>
<div class="relative group self-end inline-block text-blue-200 leading-none">
<select
v-model="season"
@change="filterSeason"
dir="rtl"
class="block appearance-none bg-transparent w-full px-4 pr-8 rounded-md cursor-pointer focus:outline-none group-hover:text-white"
>
<option v-for="(s, index) in seasons" :key="index" :value="s" class="bg-blue-800">Season {{ s }}</option>
</select>
<div
class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700"
>
<svg class="w-4 h-4 text-blue-200 group-hover:text-white">
<use xlink:href="#caret-down" />
</svg>
</div>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
data() {
return {
season: null
}
},
computed: {
...mapState({
currentseason: state => state.summoner.basic.currentSeason,
seasons: state => state.summoner.basic.seasons,
}),
},
created() {
this.season = this.currentseason
},
methods: {
filterSeason() {
console.log('filter season', this.season)
}
}
}
</script>

View file

@ -1,5 +1,5 @@
<template>
<div class="text-white">
<div class="text-white pb-2">
<div class="flex justify-between">
<div style="width: 520px; height: 239px;">
<content-loader

View file

@ -1,6 +1,6 @@
<template>
<div class="mt-3 flex text-center">
<div class="mt-4 w-3/12">
<div class="w-3/12">
<div class="bg-blue-850 rounded-lg" style="width: 300px; height: 339px;">
<content-loader
:height="339"
@ -191,7 +191,8 @@
<div
v-for="index in 10"
:key="index"
class="mt-4 ml-4 bg-blue-850 rounded-lg"
:class="{'mt-4': index !== 1}"
class="ml-4 bg-blue-850 rounded-lg"
style="width: 884px; height: 144px;"
>
<content-loader

View file

@ -62,7 +62,9 @@
<RecentActivity :matches="basic.matchList" />
</div>
</div>
<div class="flex items-center justify-between">
<!-- NAVIGATION -->
<div class="pb-2">
<router-link
:to="{ name: 'summoner', params: { region: $route.params.region, name: $route.params.name }}"
:class="isRouteActive('summoner')"
@ -87,8 +89,14 @@
class="ml-4 pb-2 border-b-2 border-transparent text-blue-300 cursor-pointer hover:text-blue-100"
exact
>live game</router-link>
</div>
<!-- Select Season -->
<FilterSeason />
</div>
</template>
<!-- View -->
<transition :name="tabTransition">
<slot></slot>
</transition>
@ -110,6 +118,7 @@
<script>
import { mapState, mapActions, mapGetters } from 'vuex'
import FilterSeason from '@/components/Summoner/FilterSeason.vue'
import LazyBackground from '@/components/LazyBackgroundImage.vue'
import MainFooter from '@/components/MainFooter.vue'
import RecentActivity from '@/components/Summoner/RecentActivity.vue'
@ -119,6 +128,7 @@ import SummonerRanked from '@/components/Summoner/SummonerRanked.vue'
export default {
components: {
FilterSeason,
LazyBackground,
MainFooter,
RecentActivity,

View file

@ -6,8 +6,10 @@ export const namespaced = true
export const state = {
basic: {
account: {},
currentSeason: 10,
matchList: [],
ranked: {},
seasons: [],
status: '',
},
overview: {
@ -79,6 +81,7 @@ export const mutations = {
state.basic.account = infos.account
state.basic.matchList = infos.matchList
state.basic.ranked = infos.ranked
state.basic.seasons = infos.seasons
state.basic.status = 'found'
state.live.match = infos.current
state.live.playing = infos.playing

View file

@ -1,6 +1,6 @@
<template>
<div v-if="overviewLoaded" key="overview" class="mt-3 flex text-center">
<div class="mt-4 w-3/12">
<div class="w-3/12">
<SummonerChampions />
<SummonerStats />
<SummonerMates />
@ -15,6 +15,7 @@
v-for="(match, index) in overview.matches"
:key="index"
:data="overview.matches[index]"
:index-match="index"
/>
</ul>
<LoadingButton

View file

@ -1,6 +1,6 @@
<template>
<div key="champions" class="mt-3">
<div class="mt-4 flex items-center">
<div class="flex items-center">
<ChampionsSearch @search-champions="updateSearch" />
<FilterQueue @filter-queue="filterByQueue" :choices="queues" class="ml-4" />
</div>

View file

@ -1,7 +1,7 @@
<template>
<div key="records" class="mt-3">
<div key="records" class="">
<template v-if="!recordsLoaded || (recordsLoaded && records.maxKda)">
<div class="mt-4">
<div class="">
<div class="mx-4 text-blue-200 text-2xl border-b-2 border-blue-800 blue-900">basics</div>
<div class="-mx-2 flex flex-wrap">
<template v-if="recordsLoaded">

View file

@ -488,7 +488,7 @@ module.exports = {
stroke: ['responsive'],
tableLayout: ['responsive'],
textAlign: ['responsive'],
textColor: ['responsive', 'hover', 'focus'],
textColor: ['responsive', 'hover', 'focus', 'group-hover'],
textDecoration: ['responsive', 'hover', 'focus'],
textTransform: ['responsive'],
userSelect: ['responsive'],