Restore smaller header on share page
This commit is contained in:
parent
1684e8c555
commit
122060e9a5
8 changed files with 42 additions and 11 deletions
|
@ -1,8 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<h1 class="title has-text-centered header"><router-link to="/" exact>
|
<div class="header" v-bind:class="{ 'share': $store.state.share }">
|
||||||
match<span class="lighter">.audio</span>
|
<div class="container">
|
||||||
</router-link></h1>
|
<h1 class="title has-text-centered">
|
||||||
|
<router-link to="/" exact>
|
||||||
|
match<span class="lighter">.audio</span>
|
||||||
|
</router-link>
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
</div>
|
</div>
|
||||||
|
@ -19,8 +25,10 @@ body {
|
||||||
color: #445470;
|
color: #445470;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
}
|
}
|
||||||
h1 {
|
.header {
|
||||||
background: #FE4365;
|
background: #FE4365;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
padding: 25px 0;
|
padding: 25px 0;
|
||||||
}
|
}
|
||||||
h1 a {
|
h1 a {
|
||||||
|
@ -29,6 +37,15 @@ h1 a {
|
||||||
h1 a:hover {
|
h1 a:hover {
|
||||||
color: #ffacc5;
|
color: #ffacc5;
|
||||||
}
|
}
|
||||||
|
.share {
|
||||||
|
margin-bottom: 40px;
|
||||||
|
}
|
||||||
|
.share h1 {
|
||||||
|
text-align: left;
|
||||||
|
font-size: 1.5em;
|
||||||
|
line-height: 36px;
|
||||||
|
padding: 5px 0;
|
||||||
|
}
|
||||||
.title a:hover {
|
.title a:hover {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ const store = new Vuex.Store({
|
||||||
recents: [],
|
recents: [],
|
||||||
item: {},
|
item: {},
|
||||||
services: [],
|
services: [],
|
||||||
|
share: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
|
@ -3,8 +3,10 @@ body {
|
||||||
color: #445470;
|
color: #445470;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
}
|
}
|
||||||
h1 {
|
.header {
|
||||||
background: #FE4365;
|
background: #FE4365;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
padding: 25px 0;
|
padding: 25px 0;
|
||||||
}
|
}
|
||||||
h1 a {
|
h1 a {
|
||||||
|
@ -13,6 +15,15 @@ h1 a {
|
||||||
h1 a:hover {
|
h1 a:hover {
|
||||||
color: #ffacc5;
|
color: #ffacc5;
|
||||||
}
|
}
|
||||||
|
.share {
|
||||||
|
margin-bottom: 40px;
|
||||||
|
}
|
||||||
|
.share h1 {
|
||||||
|
text-align: left;
|
||||||
|
font-size: 1.5em;
|
||||||
|
line-height: 36px;
|
||||||
|
padding: 5px 0;
|
||||||
|
}
|
||||||
.title a:hover {
|
.title a:hover {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
@ -75,6 +86,9 @@ p {
|
||||||
.input:focus {
|
.input:focus {
|
||||||
border-color: #FE4365;
|
border-color: #FE4365;
|
||||||
}
|
}
|
||||||
|
.search {
|
||||||
|
margin-bottom: 25vh;
|
||||||
|
}
|
||||||
form {
|
form {
|
||||||
margin-top: 25vh;
|
margin-top: 25vh;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
|
|
|
@ -60,6 +60,7 @@ export default {
|
||||||
// fetch the data when the view is created and the data is
|
// fetch the data when the view is created and the data is
|
||||||
// already being observed
|
// already being observed
|
||||||
this.fetch();
|
this.fetch();
|
||||||
|
this.$store.state.share = false;
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -58,6 +58,7 @@ export default {
|
||||||
this.interval = setInterval(() => {
|
this.interval = setInterval(() => {
|
||||||
this.fetch();
|
this.fetch();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
this.$store.state.share = true;
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
// call again the method if the route changes
|
// call again the method if the route changes
|
||||||
|
@ -69,7 +70,7 @@ export default {
|
||||||
const id = this.$route.params.id;
|
const id = this.$route.params.id;
|
||||||
if (item && item.externalId === id && (typeof window === 'undefined' || !item.matches.some(match => match.matching))) {
|
if (item && item.externalId === id && (typeof window === 'undefined' || !item.matches.some(match => match.matching))) {
|
||||||
this.item = this.$store.state.item;
|
this.item = this.$store.state.item;
|
||||||
} else {
|
} else if (id) {
|
||||||
fetchItem(this.$route.params.service, this.$route.params.type, id).then((res) => {
|
fetchItem(this.$route.params.service, this.$route.params.type, id).then((res) => {
|
||||||
if(!res.body.matches.some(match => match.matching)) {
|
if(!res.body.matches.some(match => match.matching)) {
|
||||||
clearInterval(this.interval);
|
clearInterval(this.interval);
|
||||||
|
|
|
@ -36,6 +36,7 @@ export default function* () {
|
||||||
title: 'Share Music',
|
title: 'Share Music',
|
||||||
shareUrl: `${this.request.origin}${url}`,
|
shareUrl: `${this.request.origin}${url}`,
|
||||||
image: `${this.request.origin}/assets/images/logo-512.png`,
|
image: `${this.request.origin}/assets/images/logo-512.png`,
|
||||||
|
share: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
yield this.render('index', {
|
yield this.render('index', {
|
||||||
|
|
|
@ -50,6 +50,7 @@ export default function* (serviceId, type, itemId, format) {
|
||||||
const initialState = {
|
const initialState = {
|
||||||
item: share,
|
item: share,
|
||||||
services: services.map(service => service.id),
|
services: services.map(service => service.id),
|
||||||
|
share: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
const url = `/${serviceId}/${type}/${itemId}`;
|
const url = `/${serviceId}/${type}/${itemId}`;
|
||||||
|
|
|
@ -31,11 +31,6 @@ module.exports = {
|
||||||
},
|
},
|
||||||
devtool: '#source-map',
|
devtool: '#source-map',
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.DefinePlugin({
|
|
||||||
'process.env': {
|
|
||||||
NODE_ENV: '"production"',
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
new webpack.optimize.OccurrenceOrderPlugin(),
|
new webpack.optimize.OccurrenceOrderPlugin(),
|
||||||
new CopyWebpackPlugin([{
|
new CopyWebpackPlugin([{
|
||||||
from: path.resolve(__dirname, './node_modules/bulma/css'),
|
from: path.resolve(__dirname, './node_modules/bulma/css'),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue