diff --git a/components/LPdistrib.vue b/components/LPdistrib.vue index d71068d..effd338 100644 --- a/components/LPdistrib.vue +++ b/components/LPdistrib.vue @@ -1,6 +1,7 @@ @@ -46,6 +56,7 @@ import { precise } from '~/utils/utils.js' import { mapState, mapGetters, mapActions } from 'vuex' +import LoginModal from '~/components/modals/Login.vue' import ClipLoader from 'vue-spinner/src/ClipLoader.vue' export default { @@ -62,14 +73,16 @@ export default { getExchangeClass(exchange) { return (exchange === this.exchange) ? 'active' : '' }, - ...mapActions(['fetchTopLP', 'switchExcludeWallets', 'remExcludeWallet', 'addExcludeWallet', 'setTotalNeonReward', 'setExcludedWallets']) + ...mapActions('chain', ['logout']), + ...mapActions(['sendRewards', 'fetchTopLP', 'switchExcludeWallets', 'remExcludeWallet', 'addExcludeWallet', 'setTotalNeonReward', 'setExcludedWallets']) }, computed: { - ...mapState(['excludeWalletActive', 'exchange', 'isLPLoading', 'displayedTopLP', 'totalNeonReward', 'totalLPamount']), + ...mapState(['user', 'excludeWalletActive', 'exchange', 'isLPLoading', 'displayedTopLP', 'totalNeonReward', 'totalLPamount']), ...mapGetters(['isWalletExcluded', 'getWalletShare', 'getWalletNeonOutput']), }, components: { - ClipLoader + ClipLoader, + LoginModal }, mounted() { if(!process.client) { @@ -211,7 +224,7 @@ ul { margin-top: 70px; padding: 92px 10px 46px; } -.LPdistrib img { +.LPdistrib .LPdistrib-logo { position: absolute; top: -92px; left: 50%; @@ -310,4 +323,10 @@ ul { .excludeButton span { font-size: 16px; } +.sendDistrib { + margin-top: 1em; +} +.sendDistrib button { + margin-bottom: 0.8em; +} diff --git a/components/modals/Login.vue b/components/modals/Login.vue new file mode 100644 index 0000000..b8e3ae6 --- /dev/null +++ b/components/modals/Login.vue @@ -0,0 +1,176 @@ + + + + + diff --git a/nuxt.config.js b/nuxt.config.js index 589e567..25e64a4 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -49,6 +49,7 @@ export default { // list the icons you want to add, not listed icons will be tree-shaked solid: [ 'faCheck', + 'faXmark', ], } }] diff --git a/static/logos/anchor.svg b/static/logos/anchor.svg new file mode 100644 index 0000000..785d25d --- /dev/null +++ b/static/logos/anchor.svg @@ -0,0 +1,4 @@ + + + + diff --git a/static/logos/bloks_logomark.svg b/static/logos/bloks_logomark.svg new file mode 100755 index 0000000..e1cec89 --- /dev/null +++ b/static/logos/bloks_logomark.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/logos/bos.png b/static/logos/bos.png new file mode 100644 index 0000000..3649f2e Binary files /dev/null and b/static/logos/bos.png differ diff --git a/static/logos/coffe.svg b/static/logos/coffe.svg new file mode 100755 index 0000000..76fd49e --- /dev/null +++ b/static/logos/coffe.svg @@ -0,0 +1 @@ +logo \ No newline at end of file diff --git a/static/logos/keycat.svg b/static/logos/keycat.svg new file mode 100644 index 0000000..6c344cd --- /dev/null +++ b/static/logos/keycat.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + diff --git a/static/logos/ledger.svg b/static/logos/ledger.svg new file mode 100644 index 0000000..fee0af7 --- /dev/null +++ b/static/logos/ledger.svg @@ -0,0 +1 @@ +Ресурс 2 \ No newline at end of file diff --git a/static/logos/lightapi.png b/static/logos/lightapi.png new file mode 100755 index 0000000..2942b13 Binary files /dev/null and b/static/logos/lightapi.png differ diff --git a/static/logos/lynx.svg b/static/logos/lynx.svg new file mode 100644 index 0000000..86ee671 --- /dev/null +++ b/static/logos/lynx.svg @@ -0,0 +1,15 @@ + + + + Artboard + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/static/logos/mywish.svg b/static/logos/mywish.svg new file mode 100644 index 0000000..dfb71f9 --- /dev/null +++ b/static/logos/mywish.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/static/logos/scatter.svg b/static/logos/scatter.svg new file mode 100644 index 0000000..4e77765 --- /dev/null +++ b/static/logos/scatter.svg @@ -0,0 +1,32 @@ + + + + +scatter_badge_transparent +Created with Sketch. + + + + + + + + + diff --git a/static/logos/simpleos.svg b/static/logos/simpleos.svg new file mode 100644 index 0000000..e0eb654 --- /dev/null +++ b/static/logos/simpleos.svg @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/static/logos/token_poket.png b/static/logos/token_poket.png new file mode 100644 index 0000000..a2f3da6 Binary files /dev/null and b/static/logos/token_poket.png differ diff --git a/static/logos/wax.svg b/static/logos/wax.svg new file mode 100644 index 0000000..82c4496 --- /dev/null +++ b/static/logos/wax.svg @@ -0,0 +1,68 @@ + + + + + background + + + + + + + Layer 1 + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/logos/wombat.png b/static/logos/wombat.png new file mode 100644 index 0000000..3991297 Binary files /dev/null and b/static/logos/wombat.png differ diff --git a/static/logos/yusaymon.jpeg b/static/logos/yusaymon.jpeg new file mode 100755 index 0000000..c7c73f8 Binary files /dev/null and b/static/logos/yusaymon.jpeg differ diff --git a/static/logos/zenblocks.png b/static/logos/zenblocks.png new file mode 100644 index 0000000..169ad13 Binary files /dev/null and b/static/logos/zenblocks.png differ diff --git a/store/chain.js b/store/chain.js index 8c60435..8870138 100644 --- a/store/chain.js +++ b/store/chain.js @@ -77,26 +77,28 @@ export const actions = { }, // Function not used in the app yet - transfer({ dispatch, rootState }, { contract, actor, quantity, memo, to }) { + sendRewards({ dispatch, rootState }, { rewards }) { + let actions = [] + for(let i = 0; i < rewards.length; ++i) { + actions.push({ + account: 'tokenizednft', + name: 'transfer', + authorization: [ + rootState.user.authorization + ], + data: { + from: rootState.user.name, + to: rewards[i].wallet, + quantity: precise(rewards[i].reward, 4)+' NEON', + memo: 'Defibox NEON LP weekly rewards' + } + }) + } return dispatch('sendTransaction', { - updateRoute: 'update', + updateRoute: null, updateDelay: 4000, - actions: [ - { - account: contract, - name: 'transfer', - authorization: [ - rootState.user.authorization - ], - data: { - from: actor, - to: to || rootState.network.contract, - quantity, - memo - } - } - ] + actions: actions } ) }, @@ -124,7 +126,8 @@ export const actions = { }) throw e } finally { - setTimeout(() => {dispatch(updateRoute, {updateParam}, { root: true })}, updateDelay) + if(updateRoute !== null) + setTimeout(() => {dispatch(updateRoute, {updateParam}, { root: true })}, updateDelay) } } } diff --git a/store/index.js b/store/index.js index 6657ad3..6d546d0 100644 --- a/store/index.js +++ b/store/index.js @@ -1,4 +1,5 @@ import {getTopHolders} from '~/utils/lightapihelper.js' +import {precise} from '~/utils/utils.js' export const state = () => ({ user: null, @@ -35,6 +36,20 @@ export const mutations = { } export const actions = { + async sendRewards({state, dispatch, getters}) { + if(state.totalNeonReward === 0) + return; + + let rewards = []; + + for(let i = 0; i < state.displayedTopLP.length; ++i) { + const output = 1*precise(getters.getWalletNeonOutput(state.displayedTopLP[i][0]), 4) + if(output >= 0.0001) + rewards.push({wallet: state.displayedTopLP[i][0], reward: output}) + } + + dispatch('chain/sendRewards', {rewards}, { root: true }) + }, async loadAccountData({ state, commit, dispatch }) { if (!state.user) return diff --git a/store/modal.js b/store/modal.js new file mode 100644 index 0000000..34df23f --- /dev/null +++ b/store/modal.js @@ -0,0 +1,25 @@ +export const state = () => ({ + current: '', + visible: false +}) + +export const mutations = { + setCurrent: (state, value) => state.current = value, + setVisible: (state, value) => state.visible = value +} + +export const actions = { + login({ commit, dispatch }) { + commit('setCurrent', 'login') + dispatch('setMobileMenuVisible', false, { root: true }) + commit('setVisible', true) + }, + energy({ commit, dispatch }) { + commit('setCurrent', 'energy') + dispatch('setMobileMenuVisible', false, { root: true }) + commit('setVisible', true) + }, + closeModal({ commit }) { + commit('setVisible', false) + } +}