fix and style sidebar

This commit is contained in:
Jonas Heinrich 2020-11-16 21:32:25 +01:00
parent f69bbfb523
commit 95311ebcff
2 changed files with 120 additions and 13 deletions

View File

@ -34,6 +34,9 @@
</EmptyContent> </EmptyContent>
</template> </template>
</AppContent> </AppContent>
<Sidebar
:show-sidebar="showSidebar"
:sidebar-station="sidebarStation" />
</Content> </Content>
</template> </template>
@ -47,6 +50,7 @@ import axios from '@nextcloud/axios'
import Navigation from './Navigation' import Navigation from './Navigation'
import Table from './Table' import Table from './Table'
import Sidebar from './Sidebar'
import { Howl, Howler } from 'howler' import { Howl, Howler } from 'howler'
@ -60,6 +64,7 @@ export default {
AppContent, AppContent,
Table, Table,
EmptyContent, EmptyContent,
Sidebar,
}, },
data: () => ({ data: () => ({
tableData: [], tableData: [],
@ -73,12 +78,6 @@ export default {
player() { player() {
return this.$store.state.player return this.$store.state.player
}, },
stationTags() {
if (this.sidebarStation.tags) {
return this.sidebarStation.tags.replaceAll(',', ', ')
}
return ''
},
}, },
watch: { watch: {
$route: 'onRoute', $route: 'onRoute',

View File

@ -1,14 +1,62 @@
<template> <template>
<AppSidebar v-show="showSidebar" <AppSidebar
v-show="showSidebar"
:title="sidebarStation.name" :title="sidebarStation.name"
:subtitle="stationTags" :subtitle="stationTags"
:background="sidebarStation.favicon"
class="has-preview"
@close="showSidebar=false"> @close="showSidebar=false">
<div class="configBox">
<span class="icon icon-link" />
<span class="title">
Stream URL
</span>
<div class="content">
<input type="text" :value="sidebarStation.url_resolved" disabled="disabled"> <input type="text" :value="sidebarStation.url_resolved" disabled="disabled">
<Actions> <Actions>
<ActionButton icon="icon-clippy" @click="copyLink( { url: shareUrl(share) })"> <ActionButton icon="icon-clippy" @click="copyLink( { url: shareUrl(share) })">
{{ t('radio', 'Copy link to clipboard') }} {{ t('radio', 'Copy link to clipboard') }}
</ActionButton> </ActionButton>
</Actions> </Actions>
</div>
</div>
<div class="configBox">
<span class="icon icon-external" />
<span class="title">
Homepage
</span>
<div class="content">
<span>
<a
:href="sidebarStation.homepage"
target="new">
{{ sidebarStation.homepage }}
</a>
</span>
</div>
</div>
<div class="configBox">
<span class="icon icon-details" />
<span class="title">
Country & Language
</span>
<div class="content">
<span>
{{ sidebarStation.country }}, {{ sidebarStation.language }}
</span>
</div>
</div>
<div class="configBox">
<span class="icon icon-details" />
<span class="title">
Codec & Bitrate
</span>
<div class="content">
<span>
{{ sidebarStation.codec }}, {{ sidebarStation.bitrate }}
</span>
</div>
</div>
</AppSidebar> </AppSidebar>
</template> </template>
@ -24,5 +72,65 @@ export default {
Actions, Actions,
ActionButton, ActionButton,
}, },
props: {
showSidebar: {
type: Boolean,
default() { return false },
},
sidebarStation: {
type: Array,
default() { return [] },
},
},
computed: {
stationTags() {
if (this.sidebarStation.tags) {
return this.sidebarStation.tags.replaceAll(',', ', ')
}
return ''
},
},
} }
</script> </script>
<style lang="scss" scoped>
.app-sidebar {
&.has-preview::v-deep {
.app-sidebar-header__figure {
background-size: cover;
height: 200px;
}
}
}
.configBox {
padding: 0 15px;
margin-bottom: 20px;
}
.configBox .title {
font-size: 1.2em;
display: block;
margin-bottom: 15px;
}
.configBox .icon {
float: left;
margin: 4px 7px 0px 0px;
}
.configBox .content {
display: flex;
margin-left: 25px;
}
.configBox .content input {
flex-grow: 1;
}
.configBox .content button {
margin-top: -3px;
}
</style>