Skip to content

Commit

Permalink
Vue Javascript WebWallet
Browse files Browse the repository at this point in the history
  • Loading branch information
RaulBernal authored Sep 24, 2021
1 parent 124f610 commit 07187aa
Show file tree
Hide file tree
Showing 62 changed files with 17,995 additions and 0 deletions.
27 changes: 27 additions & 0 deletions vue/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
App UI

This is the [vuejs](https://vuejs.org/) user interface for your app.

The vue.js framework for building your user interface helps with rapid app development. The framework provides UI components including a login and an HTML-based template.

## Project setup

```
npm install
```

### Compiles and hot-reloads for development

```
npm run serve
```

### Compiles and minifies for production

```
npm run build
```

### Customize configuration

See [Configuration Reference](https://cli.vuejs.org/config/).
3 changes: 3 additions & 0 deletions vue/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ['@vue/cli-plugin-babel/preset']
}
47 changes: 47 additions & 0 deletions vue/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "@starport/template",
"version": "0.1.49",
"description": "A Vue 3 boilerplate project utilizing @starport/vue and @starport/vuex",
"author": "Tendermint, Inc <[email protected]>",
"private": true,
"scripts": {
"dev": "npm install && vue-cli-service serve",
"serve": "vue-cli-service serve",
"lint": "vue-cli-service lint",
"build": "vue-cli-service build",
"test": "echo \"Error: run tests from root\" && exit 1"
},
"dependencies": {
"@cosmjs/launchpad": "0.25.0",
"@cosmjs/proto-signing": "0.25.0",
"@cosmjs/stargate": "0.25.0",
"@starport/vue": "^0.1.49",
"@starport/vuex": "^0.1.49",
"@vue/compiler-sfc": "^3.0.11",
"bip39": "^3.0.4",
"core-js": "^3.11.2",
"crypto-js": "^4.0.0",
"file-saver": "^2.0.5",
"vue": "^3.0.11",
"vue-router": "^4.0.3",
"vue-uuid": "^2.0.2",
"vuex": "^4.0.0"
},
"devDependencies": {
"@babel/core": "^7.14.0",
"@babel/node": "^7.13.13",
"@vue/cli-plugin-babel": "^4.5.12",
"@vue/cli-plugin-eslint": "^4.5.12",
"@vue/cli-plugin-vuex": "^4.5.12",
"@vue/cli-service": "^4.5.12",
"@vue/eslint-config-prettier": "^6.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.8.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-vue": "^7.9.0",
"node-sass": "^4.12.0",
"prettier": "^2.2.1",
"protobufjs": "^6.11.2",
"sass-loader": "^8.0.2"
}
}
Binary file added vue/public/favicon.ico
Binary file not shown.
19 changes: 19 additions & 0 deletions vue/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="stylesheet">
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app" class="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
49 changes: 49 additions & 0 deletions vue/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<template>
<div v-if="initialized">
<SpWallet ref="wallet" v-on:dropdown-opened="$refs.menu.closeDropdown()" />
<SpLayout>
<template v-slot:sidebar>
<Sidebar />
</template>
<template v-slot:content>
<router-view />
</template>
</SpLayout>
</div>
</template>

<style>
body {
margin: 0;
}
</style>

<script>
import './scss/app.scss'
import '@starport/vue/lib/starport-vue.css'
import Sidebar from './components/Sidebar'
export default {
components: {
Sidebar
},
data() {
return {
initialized: false
}
},
computed: {
hasWallet() {
return this.$store.hasModule(['common', 'wallet'])
}
},
async created() {
await this.$store.dispatch('common/env/init')
this.initialized = true
},
errorCaptured(err) {
console.log(err)
return false
}
}
</script>
41 changes: 41 additions & 0 deletions vue/src/components/Sidebar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<template>
<SpSidebar
v-on:sidebar-open="sidebarOpen = true"
v-on:sidebar-close="sidebarOpen = false"
>
<template v-slot:default>
<SpLinkIcon link="/" text="Dashboard" icon="Dashboard" />
<SpLinkIcon link="/types" text="Custom Type" icon="Form" />
<SpLinkIcon link="/relayers" text="Relayers" icon="Transactions" />
<div class="sp-dash"></div>
<SpLinkIcon
href="https://github.com/tendermint/starport"
target="_blank"
text="Documentation"
icon="Docs"
/>
</template>
<template v-slot:footer>
<SpStatusAPI :showText="sidebarOpen" />
<SpStatusRPC :showText="sidebarOpen" />
<SpStatusWS :showText="sidebarOpen" />
<div class="sp-text">Build: v0.3.8</div>
</template>
</SpSidebar>
</template>

<script>
export default {
name: 'Sidebar',
data() {
return {
sidebarOpen: true
}
},
computed: {
hasWallet() {
return this.$store.hasModule(['common', 'wallet'])
}
}
}
</script>
9 changes: 9 additions & 0 deletions vue/src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { createApp } from 'vue'
import App from './App.vue'
import store from './store'
import router from './router'
import vueLib from '@starport/vue'

const app = createApp(App)
app.config.globalProperties._depsLoaded = true
app.use(store).use(router).use(vueLib).mount('#app')
21 changes: 21 additions & 0 deletions vue/src/router/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { createRouter, createWebHistory } from 'vue-router'
import Index from '@/views/Index.vue'
import Types from '@/views/Types.vue'
import Relayers from '@/views/Relayers.vue'

const routerHistory = createWebHistory()
const routes = [
{
path: '/',
component: Index
},
{ path: '/types', component: Types },
{ path: '/relayers', component: Relayers }
]

const router = createRouter({
history: routerHistory,
routes
})

export default router
1 change: 1 addition & 0 deletions vue/src/scss/app.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//Your custom styles here
12 changes: 12 additions & 0 deletions vue/src/store/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { env, blocks, wallet, transfers, relayers } from '@starport/vuex'
import generated from './generated'
export default function init(store) {
for (const moduleInit of Object.values(generated)) {
moduleInit(store)
}
transfers(store)
blocks(store)
env(store)
wallet(store)
relayers(store)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Bitcannaid } from "./module/types/bcna/bitcannaid";
import { Supplychain } from "./module/types/bcna/supplychain";
export { Bitcannaid, Supplychain };
declare const _default;
export default _default;
Loading

0 comments on commit 07187aa

Please sign in to comment.