Skip to content

Commit

Permalink
fe minor changes (#19)
Browse files Browse the repository at this point in the history
* raffle minor changes

* try catch around suggestChain

* env
  • Loading branch information
magiodev authored May 22, 2024
1 parent 9d9ddff commit 1351e8b
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion frontend-common/mixin/chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const mxChain = {

methods: {
async suggestChain() {
await window.keplr.experimentalSuggestChain(JSON.parse(process.env.VUE_APP_CHAIN_INFO));
await window.keplr?.experimentalSuggestChain(JSON.parse(process.env.VUE_APP_CHAIN_INFO));
},

async allocateTokens(potId, amount) {
Expand Down
2 changes: 1 addition & 1 deletion frontend-ms/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ VUE_APP_CHAIN_ID=osmo-test-5
VUE_APP_BASE_FEE=0.0025
VUE_APP_EXPLORER_BASE_URL=https://celatone.osmosis.zone

VUE_APP_CONTRACT=osmo1t33we3pcqf9u3jn665r9nf0nl3yqav2dg33njdcfm8thl7hvv9ts53gfay
VUE_APP_CONTRACT=osmo1zs6565tanh04s4nfd4vmftkc7mkq8sxgxsmtnczfe76ym9f0f49sdda7rp
VUE_APP_CONTRACT_CW721=osmo1

VUE_APP_INTERVAL_TIMEOUT=10000
Expand Down
6 changes: 5 additions & 1 deletion frontend-ms/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ export default {
},
async created() {
await this.suggestChain()
try {
await this.suggestChain()
} catch (e) {
//console.error(e)
}
await this.fetchOnce();
await this.fetchInterval()
// we ensure that till this moment rest of UI is kept idle
Expand Down
12 changes: 5 additions & 7 deletions frontend-ms/src/components/Common/RaffleComponent.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<template>
<div class="raffle-component row text-center" v-if="raffle?.nft?.id || Number(raffle.denom_amount)">
<div class="title col-12 py-2">
<div class="title col-12 pt-3">
<h3 class="mb-0">Raffle Prizes!</h3>
</div>

<div class="col-4 offset-2 col-md-3 offset-md-3 raffle-item py-2">
<div class="pp-card p-2">
<div class="pp-card p-2 h-100">
<h5 v-if="raffle?.nft?.id" class="text-pp-color-4">MS #{{ raffle.nft.id }}</h5>
<img v-if="raffle?.nft?.imageUrl" class="nft-image mb-0" :src="raffle.nft.imageUrl" alt="MS"/>
</div>
</div>

<div class="col-4 col-md-3 raffle-item py-2">
<div class="pp-card p-2">
<h5 v-if="raffle.denom_amount" class="text-pp-color-4">$</h5>
<div class="pp-card p-2 h-100">
<h5 v-if="raffle.denom_amount" class="text-pp-color-4">$OSMO</h5>
<span class="text-pp-color-4">{{ displayAmount(raffle.denom_amount, 2) }}</span> <CoinComponent/>
</div>
</div>
Expand All @@ -40,9 +40,7 @@ export default {
<style lang="scss" scoped>
@import "@/assets/style";
.raffle-component {
.title {
border-bottom: 1px solid $pp-color-4;
}
.raffle-item {
.nft-image {
border-radius: 1em;
Expand Down
2 changes: 1 addition & 1 deletion frontend-ms/src/components/Game/PlayersAllocations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</td>
</tr>
<tr>
<td>Denom Prize</td>
<td>$OSMO Prize</td>
<td>
{{ displayAmount(raffle.denom_amount, 2) }}
<CoinComponent/>
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ export default {
},
async created() {
await this.suggestChain()
try {
await this.suggestChain()
} catch (e) {
//console.error(e)
}
await this.fetchOnce();
await this.fetchInterval()
// we ensure that till this moment rest of UI is kept idle
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/Common/RaffleComponent.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<template>
<div class="raffle-component row text-center" v-if="raffle?.nft?.id || Number(raffle.denom_amount)">
<div class="title col-12 py-2">
<div class="title col-12 pt-3">
<h3 class="mb-0">Raffle Prizes!</h3>
</div>

<div class="col-4 offset-2 col-md-3 offset-md-3 raffle-item py-2">
<div class="pp-card p-2">
<div class="pp-card p-2 h-100">
<h5 v-if="raffle?.nft?.id" class="text-pp-color-4">{NFT_NAME} #{{ raffle.nft.id }}</h5>
<img v-if="raffle?.nft?.imageUrl" class="nft-image mb-0" :src="raffle.nft.imageUrl" alt="{NFT_NAME}"/>
</div>
</div>

<div class="col-4 col-md-3 raffle-item py-2">
<div class="pp-card p-2">
<div class="pp-card p-2 h-100">
<h5 v-if="raffle.denom_amount" class="text-pp-color-4">$DENOM</h5>
<span class="text-pp-color-4">{{ displayAmount(raffle.denom_amount, 2) }}</span> <CoinComponent/>
</div>
Expand Down

0 comments on commit 1351e8b

Please sign in to comment.