Commit 4acd478e authored by Bitcoin Please's avatar Bitcoin Please

Added banner to media.

parent 9eea3958
......@@ -55,7 +55,7 @@
<div class="author-profile">
<a class="author-icon" href="javascript://">
<img :src="ownerAvatar" alt=""></a>
by <a class="author-name" href="javascript://">{{ownerNickname}}</a>
by <a class="author-name" href="javascript://">{{ownerName}}</a>
</div>
<div class="author-address">
......@@ -373,11 +373,11 @@ export default {
},
/**
* Owner Nickname
* Owner Name
*/
ownerNickname() {
if (this.campaign && this.campaign.owner.nickname) {
return this.campaign.owner.nickname
ownerName() {
if (this.campaign && (this.campaign.owner.label || this.campaign.owner.nickname)) {
return this.campaign.owner.label || this.campaign.owner.nickname
} else {
return null
}
......
......@@ -170,7 +170,7 @@ import Nito from 'nitojs'
import numeral from 'numeral'
import QRCode from 'qrcode'
import superagent from 'superagent'
import Swal from 'sweetalert2'
// import Swal from 'sweetalert2'
// const { Contract, SignatureTemplate } = require('cashscript')
import { Contract, SignatureTemplate } from 'cashscript'
......@@ -247,7 +247,13 @@ export default {
}
}
QRCode.toString(this.pledgeAddress, params, (err, value) => {
/* Calculate pledge amount (in BCH). */
const amount = parseFloat(this.pledgeSatoshis / 100000000.0)
/* Set payment URL. */
const paymentUrl = `${this.pledgeAddress}?amount=${amount}`
QRCode.toString(paymentUrl, params, (err, value) => {
if (err) {
return console.error('QR Code ERROR:', err)
}
......@@ -385,23 +391,25 @@ export default {
* Wallet Pay
*/
walletPay() {
Swal.fire({
title: 'Are you sure?',
text: "You won't be able to revert this!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.value) {
Swal.fire(
'Deleted!',
'Your file has been deleted.',
'success'
)
}
})
this.toast(['Oops!', 'Your wallet balance is not enough', 'error'])
// Swal.fire({
// title: 'Are you sure?',
// text: "You won't be able to revert this!",
// icon: 'warning',
// showCancelButton: true,
// confirmButtonColor: '#3085d6',
// cancelButtonColor: '#d33',
// confirmButtonText: 'Yes, delete it!'
// }).then((result) => {
// if (result.value) {
// Swal.fire(
// 'Deleted!',
// 'Your file has been deleted.',
// 'success'
// )
// }
// })
},
/**
......
......@@ -118,8 +118,13 @@ export default {
return article
})
/* Sort by date (newest first). */
articles.sort((a, b) => {
return b.createdAt - a.createdAt
})
/* Return (reversed) array. */
return articles.reverse()
return articles
},
......
......@@ -46,7 +46,10 @@ export default {
watch: {
campaign: function (_campaign) {
if (_campaign && _campaign.title) {
console.log('CAMPAIGN HAS CHANGED, UPDATE TITLE!!', _campaign)
// console.log('CAMPAIGN HAS CHANGED, UPDATE TITLE!!', _campaign)
/* Update banner. */
this.updateBanner()
/* Update title. */
this.updateTitle()
......@@ -66,11 +69,16 @@ export default {
* Update Banner
*/
updateBanner() {
/* Set banner URL. */
// this.bannerUrl = 'https://i.imgur.com/3UPJZT6.jpg' // sofa
// this.bannerUrl = 'https://i.imgur.com/2NuUJxd.jpg' // headphones
this.bannerUrl = 'https://i.imgur.com/JQbiIbD.jpg' // working @ desk
// this.bannerUrl = 'https://i.imgur.com/9vNfGgt.jpg' // organized desk
if (this.campaign && this.campaign.media && this.campaign.media.banner) {
/* Set banner URL. */
this.bannerUrl = this.campaign.media.banner
} else {
/* Set banner URL. */
// this.bannerUrl = 'https://i.imgur.com/3UPJZT6.jpg' // sofa
// this.bannerUrl = 'https://i.imgur.com/2NuUJxd.jpg' // headphones
this.bannerUrl = 'https://i.imgur.com/JQbiIbD.jpg' // working @ desk
// this.bannerUrl = 'https://i.imgur.com/9vNfGgt.jpg' // organized desk
}
},
/**
......
......@@ -117,6 +117,31 @@
<hr />
<div class="field">
<label for="uploadfile">
Campaign Banner Image
</label>
<!-- <span class="label-desc">
This is the first thing that people will see when they come across your campaign.
Choose an image that’s crisp and text-free.
570px by 400px recommended resolution.
<a href="javascript://">Here are some tips.</a>
</span> -->
<img :src="bannerUrl" />
<input
type="text"
id="capaignstory"
placeholder="Banner URL"
v-model="bannerUrl"
>
</div>
<hr />
<div class="field">
<label for="uploadfile1">
Campaign Video
......@@ -286,6 +311,8 @@ export default {
// fundId: null,
// referrerId: null,
bannerUrl: null,
videoCaption: null,
videoDescription: null,
......@@ -349,6 +376,7 @@ export default {
/* Set media. */
const media = {
main: this.photo1Url || null,
banner: this.bannerUrl || null,
cover: this.photo1Url || null,
gallery: [
this.photo2Url || null,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment