-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.js
72 lines (61 loc) · 1.66 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import Vue from 'vue'
import Dashboard from './views/Dashboard.vue'
import Donate from './views/Donate.vue'
import NotFound from './views/NotFound.vue'
import LoadScript from 'vue-plugin-load-script';
import EvaIcons from 'vue-eva-icons'
// import VuetifyToast from 'vuetify-toast-snackbar'
import Notifications from 'vue-notification'
import AsyncComputed from 'vue-async-computed'
import Tooltip from 'vue-directive-tooltip';
import VueMdl from 'vue-mdl'
import 'vue-directive-tooltip/css/index.css';
import 'dialog-polyfill/dist/dialog-polyfill.css';
Vue.use(AsyncComputed)
Vue.use(Tooltip);
Vue.use(Notifications)
Vue.use(VueMdl)
Vue.use(LoadScript)
Vue.use(EvaIcons)
Vue.use(require('vue-moment'));
Vue.config.productionTip = false
new Vue({
data: {
currentRoute: window.location.href
},
computed: {
ViewComponent () {
if (this.currentRoute.includes('dashboard')) {
return Dashboard
} else if (this.currentRoute.includes('donate')) {
return Donate
} else {
return Dashboard
}
}
},
render (h) {
return h(this.ViewComponent)
}
}).$mount('#app');
Vue.loadScript("https://verify.sendwyre.com/js/widget-loader.js")
.then(() => {
window.widget = new Wyre.Widget({
env: "test",
accountId: "AC_VVUQ24V9LDP",
auth: { type: "metamask" },
operation: {
type: "debitcard",
dest: "ethereum:0x55DbDAB581c4D5318901e9e35608444Cc2A3142d",
sourceCurrency: "USD",
destCurrency: "DAI",
destAmount: 10
}
});
window.widget.on('complete', function(event) {
console.log(event);
});
})
.catch(() => {
// Failed to fetch script
});