change recent menu entry to new

This commit is contained in:
Jonas Heinrich 2020-10-26 15:51:22 +01:00
parent 31eb5f3c63
commit 46b105fe4d
6 changed files with 24 additions and 9 deletions

View File

@ -29,7 +29,7 @@ return [
'routes' => [
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
['name' => 'page#index', 'url' => '/top', 'verb' => 'GET', 'postfix' => 'top'],
['name' => 'page#index', 'url' => '/recent', 'verb' => 'GET', 'postfix' => 'recent'],
['name' => 'page#index', 'url' => '/new', 'verb' => 'GET', 'postfix' => 'new'],
['name' => 'page#index', 'url' => '/favorites', 'verb' => 'GET', 'postfix' => 'favorites'],
['name' => 'page#index', 'url' => '/categories', 'verb' => 'GET', 'postfix' => 'categories'],
['name' => 'radio_api#preflighted_cors', 'url' => '/api/0.1/{path}',

View File

@ -79,7 +79,7 @@ export default {
case 'TOP':
this.loadStations()
break
case 'RECENT':
case 'NEW':
this.loadStations()
break
case 'FAVORITES':

View File

@ -6,9 +6,9 @@
icon="icon-category-dashboard"
:title="t('radio', 'Top')" />
<AppNavigationItem
:to="{ name: 'RECENT' }"
:to="{ name: 'NEW' }"
icon="icon-category-monitoring"
:title="t('radio', 'Recent')" />
:title="t('radio', 'New')" />
<AppNavigationItem
:to="{ name: 'FAVORITES' }"
icon="icon-favorite"

View File

@ -5,7 +5,8 @@
:class="{ buffering: player.isBuffering }">
<button
class="player"
:class="player.isPlaying ? 'pause' : 'play'" />
:class="player.isPlaying ? 'pause' : 'play'"
@click="togglePlay" />
</div>
<div
class="volumeIcon"
@ -38,6 +39,9 @@ export default {
toggleMute() {
this.$store.dispatch('toggleMute')
},
togglePlay() {
this.$store.dispatch('togglePlay')
},
},
}
</script>
@ -120,7 +124,7 @@ export default {
}
.volume{
width: 170px;
width: 165px;
display: inline-block;
position: relative;
left: 40px;

View File

@ -21,9 +21,9 @@ export default new Router({
name: 'TOP',
},
{
path: '/recent',
path: '/new',
component: Main,
name: 'RECENT',
name: 'NEW',
},
{
path: '/favorites',

View File

@ -30,6 +30,14 @@ export default new Vuex.Store({
state.player.volume = 0
}
},
togglePlay(state) {
console.log('toggle play')
if (state.player.isPlaying) {
state.player.isPlaying = false
} else {
state.player.isPlaying = true
}
},
},
actions: {
isPlaying(context, playerState) {
@ -42,7 +50,10 @@ export default new Vuex.Store({
context.commit('changeVolume', volume)
},
toggleMute(context) {
context.toggleMute()
context.commit('toggleMute')
},
togglePlay(context) {
context.commit('togglePlay')
},
},
})