Finish up Hook

This commit is contained in:
Kristian Polso 2018-04-27 13:30:56 +03:00
parent 835150578f
commit 1ad95b6de7
4 changed files with 18 additions and 5 deletions

View file

@ -67,10 +67,13 @@ export default {
},
created () {
var component = this;
EventBus.$on('file-uploaded', function(txhash) {
EventBus.$on('HookFileUploaded', function(txhash) {
component.txhash = txhash;
component.uploadDialog = true;
});
EventBus.$on('HookStepUpdate', function(step) {
component.activeStep = step;
});
},
name: 'Hook'
}

View file

@ -20,7 +20,7 @@
<v-flex xs12 v-if="jsonData">
<p class="subheading">Success! Here is the response for <strong>lbry://{{ address }}</strong>:</p>
<pre v-highlightjs="jsonData" class="json-example"><code class="json"></code></pre>
<v-btn large v-on:click="$router.push('step-2')" class="mt-3">Go to next step</v-btn>
<v-btn large v-on:click="goTo(2)" class="mt-3">Go to next step</v-btn>
</v-flex>
<template v-if="!isLoading && !jsonData">
<v-flex xs12>
@ -80,6 +80,8 @@
</template>
<script>
import EventBus from '../event-bus';
export default {
data () {
return {
@ -104,6 +106,9 @@ export default {
var component = this;
component.address = address;
component.fetchMetadata();
},
goTo (page) {
EventBus.$emit('HookStepUpdate', page);
}
},
name: 'Step1'

View file

@ -105,7 +105,7 @@ export default {
},
submit () {
// TODO: Do the upload
EventBus.$emit('file-uploaded', 'txhashhere');
EventBus.$emit('HookFileUploaded', 'txhashhere');
},
imagesLoaded (instance) {
var component = this;

View file

@ -5,7 +5,7 @@
<h1 class="display-2">Support your favorite content creators with LBRY</h1>
<p class="subheading">Send LBRY coins to claim addresses and the owner will receive it in their wallet.</p>
<p class="subheading">To send LBC to someone, you need either their wallet address or claim ID.<br/>
You can get claim ID's by using resolve method in <router-link to="/">the first step</router-link><br/>
You can get claim ID's by using resolve method in <a href="#" v-on:click.stop="goTo(1)">the first step</a><br/>
Or you can use the examples below.</p>
</v-flex>
<v-flex xs12 sm8>
@ -88,6 +88,8 @@
</template>
<script>
import EventBus from '../event-bus';
export default {
data () {
return {
@ -99,7 +101,7 @@ export default {
}
},
methods: {
send: function() {
send () {
var component = this;
component.jsonData = '';
component.isLoading = true;
@ -113,6 +115,9 @@ export default {
var component = this;
component.address = address;
component.send();
},
goTo (page) {
EventBus.$emit('HookStepUpdate', page);
}
},
name: 'Step3'