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' => [ 'routes' => [
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'], ['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
['name' => 'page#index', 'url' => '/top', 'verb' => 'GET', 'postfix' => 'top'], ['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' => '/favorites', 'verb' => 'GET', 'postfix' => 'favorites'],
['name' => 'page#index', 'url' => '/categories', 'verb' => 'GET', 'postfix' => 'categories'], ['name' => 'page#index', 'url' => '/categories', 'verb' => 'GET', 'postfix' => 'categories'],
['name' => 'radio_api#preflighted_cors', 'url' => '/api/0.1/{path}', ['name' => 'radio_api#preflighted_cors', 'url' => '/api/0.1/{path}',

View File

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

View File

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

View File

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

View File

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

View File

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