2022-07-14 15:31:37 -04:00
|
|
|
<template>
|
|
|
|
<div class="proposals-box">
|
|
|
|
<div class="columns is-gapless">
|
|
|
|
<div class="column proposals-box--tags">
|
2022-07-29 00:57:40 -04:00
|
|
|
<div class="proposals-box--tag-item">
|
|
|
|
<div class="tag proposals-box--id">
|
|
|
|
<span><number-format :value="votes" /> TORN</span>
|
|
|
|
</div>
|
2022-07-14 15:31:37 -04:00
|
|
|
</div>
|
|
|
|
|
2022-07-29 00:57:40 -04:00
|
|
|
<div class="proposals-box--tag-item">
|
|
|
|
<b-tooltip
|
|
|
|
:label="ens.voter || voter"
|
|
|
|
position="is-top"
|
|
|
|
:multilined="ens.voter && ens.voter.length > 50"
|
|
|
|
>
|
|
|
|
<a
|
|
|
|
target="_blank"
|
|
|
|
:href="addressExplorerUrl(voter)"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
class="tag proposals-box--id is-link"
|
|
|
|
v-text="shortVoter"
|
|
|
|
/>
|
|
|
|
</b-tooltip>
|
|
|
|
</div>
|
2022-07-14 15:31:37 -04:00
|
|
|
|
2022-07-29 00:57:40 -04:00
|
|
|
<div v-if="delegator" class="proposals-box--tag-item">
|
|
|
|
<b-tooltip
|
|
|
|
:label="ens.delegator || delegator"
|
|
|
|
position="is-top"
|
|
|
|
:multilined="ens.delegator && ens.delegator.length > 50"
|
|
|
|
>
|
|
|
|
<a
|
|
|
|
target="_blank"
|
|
|
|
:href="addressExplorerUrl(delegator)"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
class="tag proposals-box--id is-link"
|
|
|
|
v-text="$t('delegate')"
|
|
|
|
/>
|
|
|
|
</b-tooltip>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="proposals-box--tag-item is-percentage">
|
|
|
|
<div class="tag proposals-box--id is-percentage">{{ percentage || '~0.1' }}%</div>
|
2022-07-14 15:31:37 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-07-29 00:57:40 -04:00
|
|
|
<div class="proposals-box--comment">
|
|
|
|
<b-icon
|
|
|
|
:icon="support ? 'check' : 'close'"
|
|
|
|
:type="support ? 'is-primary' : 'is-danger'"
|
|
|
|
class="proposals-box--status-icon"
|
|
|
|
/>
|
|
|
|
<span v-if="loading" class="proposals-box--skeleton">
|
|
|
|
<b-skeleton height="21" width="260" style="width: auto;" />
|
|
|
|
</span>
|
|
|
|
<template v-else>
|
|
|
|
<span v-if="contact" class="proposals-box--title">{{ contact }}</span>
|
|
|
|
<span v-if="message" class="proposals-box--info">{{ message }}</span>
|
|
|
|
<span v-if="!contact && !message">-</span>
|
|
|
|
</template>
|
|
|
|
</div>
|
2022-07-14 15:31:37 -04:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-07-29 00:57:40 -04:00
|
|
|
import { mapGetters } from 'vuex'
|
|
|
|
import { sliceAddress, sliceEnsName } from '@/utils'
|
2022-07-14 15:31:37 -04:00
|
|
|
import NumberFormat from '@/components/NumberFormat'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
NumberFormat
|
|
|
|
},
|
|
|
|
inheritAttrs: false,
|
|
|
|
props: {
|
2022-07-29 00:57:40 -04:00
|
|
|
loading: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true
|
|
|
|
},
|
2022-07-14 15:31:37 -04:00
|
|
|
contact: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
message: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
support: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
votes: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
voter: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
},
|
2022-07-29 00:57:40 -04:00
|
|
|
percentage: {
|
|
|
|
type: Number,
|
2022-07-14 15:31:37 -04:00
|
|
|
required: true
|
|
|
|
},
|
|
|
|
delegator: {
|
|
|
|
type: String,
|
|
|
|
default: ''
|
2022-07-29 00:57:40 -04:00
|
|
|
},
|
|
|
|
ens: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
validator: (props) => 'delegator' in props && 'voter' in props
|
2022-07-14 15:31:37 -04:00
|
|
|
}
|
|
|
|
},
|
2022-07-29 00:57:40 -04:00
|
|
|
computed: {
|
|
|
|
...mapGetters('txHashKeeper', ['addressExplorerUrl']),
|
|
|
|
|
|
|
|
shortVoter() {
|
|
|
|
return sliceEnsName(this.ens.voter || '') || sliceAddress(this.voter)
|
|
|
|
}
|
|
|
|
}
|
2022-07-14 15:31:37 -04:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2022-07-29 00:57:40 -04:00
|
|
|
$margin: 0.714rem;
|
|
|
|
|
2022-07-14 15:31:37 -04:00
|
|
|
.proposals-box {
|
|
|
|
cursor: default;
|
|
|
|
|
|
|
|
.tag {
|
|
|
|
width: 100%;
|
2022-07-29 00:57:40 -04:00
|
|
|
margin: 0;
|
|
|
|
|
|
|
|
&.is-link {
|
|
|
|
text-decoration: none;
|
|
|
|
background-color: #363636;
|
|
|
|
transition: background-color 0.15s ease-in-out;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background-color: rgba(#363636, 0.5);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.is-percentage {
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
background: transparent;
|
|
|
|
text-align: right;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.columns {
|
|
|
|
margin-bottom: 0;
|
2022-07-14 15:31:37 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
&--tags {
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
2022-07-29 00:57:40 -04:00
|
|
|
margin: calc(#{-$margin * 0.5}) !important;
|
2022-07-14 15:31:37 -04:00
|
|
|
}
|
|
|
|
|
2022-07-29 00:57:40 -04:00
|
|
|
&--tag-item {
|
|
|
|
margin: calc(#{$margin * 0.5});
|
|
|
|
width: auto;
|
|
|
|
min-width: 110px;
|
2022-07-14 15:31:37 -04:00
|
|
|
|
2022-07-29 00:57:40 -04:00
|
|
|
@media screen and (max-width: 600px) {
|
|
|
|
width: calc(50% - #{$margin});
|
|
|
|
}
|
|
|
|
|
|
|
|
& > * {
|
|
|
|
display: flex;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.is-percentage {
|
|
|
|
min-width: auto;
|
|
|
|
margin-left: auto;
|
|
|
|
}
|
2022-07-14 15:31:37 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
&--title,
|
|
|
|
&--info {
|
|
|
|
word-break: break-word;
|
2022-07-29 00:57:40 -04:00
|
|
|
display: inline;
|
|
|
|
}
|
|
|
|
|
|
|
|
&--status-icon {
|
|
|
|
vertical-align: middle;
|
|
|
|
margin-bottom: 0.2rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
&--comment {
|
|
|
|
margin-top: 1.5rem;
|
2022-07-14 15:31:37 -04:00
|
|
|
}
|
|
|
|
|
2022-07-29 00:57:40 -04:00
|
|
|
&--skeleton {
|
|
|
|
display: inline-block;
|
2022-07-14 15:31:37 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|