-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #261 from telosnetwork/develop
rc1.1.0
- Loading branch information
Showing
86 changed files
with
8,130 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<template> | ||
<div v-if="avatar && !isError" :class="childClass"> | ||
<q-avatar v-bind:size="size"> | ||
<img @error="onError" v-bind:src="avatar" /> | ||
</q-avatar> | ||
</div> | ||
<div v-else :class="childClass"> | ||
<profile-avatar | ||
:size="size" | ||
:avatar="isError ? null : avatar" | ||
:account="account_name" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { GET_TABLE_ROWS } from '../../pages/resolve/util/fetch'; | ||
import ProfileAvatar from 'src/pages/profiles/ProfileAvatar.vue'; | ||
import md5 from 'md5'; | ||
export default { | ||
name: 'TelosProfileAvatar', | ||
components: { | ||
ProfileAvatar, | ||
}, | ||
props: ['account_name', 'size', 'childClass'], | ||
data() { | ||
return { | ||
isError: false, | ||
avatar: '', | ||
hash: md5(this.account_name || ''), | ||
styleClass: this.size | ||
? { ...this.childClass, height: this.size, width: this.size } | ||
: this.childClass, | ||
}; | ||
}, | ||
methods: { | ||
onError() { | ||
console.log('Telos profile image load error'); | ||
this.isError = true; | ||
}, | ||
}, | ||
async beforeMount() { | ||
try { | ||
const { rows } = await GET_TABLE_ROWS({ | ||
code: 'profiles', | ||
scope: 'profiles', | ||
table: 'profiles', | ||
json: true, | ||
limit: 1, | ||
lower_bound: this.account_name, | ||
upper_bound: this.account_name, | ||
}); | ||
const [profile] = rows; | ||
if (profile) { | ||
const { avatar } = profile; | ||
if (profile.account_name === this.account_name) { | ||
if (avatar) { | ||
this.avatar = avatar; | ||
} | ||
} | ||
} | ||
} catch (err) { | ||
console.log('err: ', err); | ||
} | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
.profile-avatar { | ||
display: inline; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<template> | ||
<q-btn-dropdown id="resolve-menu-dropdown" class="header-submenu-tab" :class="{'resolve-dropdown-active': isResolveRoute}" auto-close stretch flat label="Resolve"> | ||
<q-list> | ||
<q-item | ||
clickable | ||
@click="$router.push('/resolve')" | ||
> | ||
<q-item-section> | ||
<q-item-label> | ||
{{$t('pages.resolve.menu_welcome')}} | ||
</q-item-label> | ||
</q-item-section> | ||
</q-item> | ||
<q-item | ||
clickable | ||
@click="$router.push('/resolve/elections')" | ||
> | ||
<q-item-section> | ||
<q-item-label> | ||
{{$t('pages.resolve.menu_elections')}} | ||
</q-item-label> | ||
</q-item-section> | ||
</q-item> | ||
<q-item | ||
clickable | ||
@click="$router.push('/resolve/arbitrator')" | ||
v-if="selfArbitrator" | ||
> | ||
<q-item-section> | ||
<q-item-label> | ||
{{$t('pages.resolve.menu_arbitrator')}} | ||
</q-item-label> | ||
</q-item-section> | ||
</q-item> | ||
<q-item | ||
clickable | ||
@click="$router.push('/resolve/cases')" | ||
> | ||
<q-item-section> | ||
<q-item-label> | ||
{{$t('pages.resolve.menu_cases')}} | ||
</q-item-label> | ||
</q-item-section> | ||
</q-item> | ||
<q-item | ||
v-if="isAuthenticated" | ||
clickable | ||
@click="$router.push('/resolve/account')" | ||
> | ||
<q-item-section> | ||
<q-item-label> | ||
{{$t('pages.resolve.menu_account')}} | ||
</q-item-label> | ||
</q-item-section> | ||
</q-item> | ||
</q-list> | ||
</q-btn-dropdown> | ||
</template> | ||
|
||
<script lang="js"> | ||
import { mapGetters } from 'vuex'; | ||
export default { | ||
computed: { | ||
...mapGetters({ | ||
isAuthenticated: 'accounts/account', | ||
selfArbitrator: 'resolve/isArbitrator', | ||
}), | ||
isResolveRoute () { | ||
return this.$route.path.includes('/resolve'); | ||
} | ||
}, | ||
mounted () { | ||
const el = document.getElementById('resolve-menu-dropdown'); | ||
const bottomBorder = document.createElement('div'); | ||
bottomBorder.classList.add('resolve-dropdown-bottom'); | ||
el?.appendChild(bottomBorder); | ||
} | ||
}; | ||
</script> | ||
<style lang="scss"> | ||
.resolve-dropdown-active { | ||
.resolve-dropdown-bottom { | ||
height: 5px; | ||
border-radius: 5px 5px 0 0; | ||
transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) 0s; | ||
transform: none; | ||
opacity: 1; | ||
transform-origin: left /* rtl:ignore */; | ||
color: $primary; | ||
background: currentColor; | ||
right: 0; | ||
bottom: 0; | ||
left: 0; | ||
position: absolute; | ||
} | ||
} | ||
</style> |
Oops, something went wrong.