-
Notifications
You must be signed in to change notification settings - Fork 77
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 #22 from liquality/feature-swap-screens
Feature ui fixes and swap screens
- Loading branch information
Showing
25 changed files
with
295 additions
and
131 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "liquality-wallet", | ||
"version": "0.10.2", | ||
"version": "0.10.3", | ||
"private": true, | ||
"license": "MIT", | ||
"author": "Liquality <[email protected]>", | ||
|
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 |
---|---|---|
|
@@ -500,4 +500,9 @@ svg.qr-icon { | |
|
||
.btn-footer { | ||
width: 9.5rem; | ||
} | ||
|
||
.selectors-asset { | ||
width: 40px; | ||
font-weight: bold; | ||
} |
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,141 @@ | ||
<template> | ||
<div class="dropdown asset-list-search"> | ||
<button class="btn btn-icon dropdown-toggle" | ||
@click="toogle"> | ||
<div class="form"> | ||
<div class="input-group"> | ||
<img | ||
:src="getAssetIcon(selectedAsset)" | ||
class="asset-icon" | ||
/> | ||
<span class="input-group-text"> | ||
{{ selectedAsset }} | ||
</span> | ||
</div> | ||
</div> | ||
</button> | ||
<ul class="dropdown-menu" :class="{ show: dropdownOpen }"> | ||
<li> | ||
<div class="form dropdown-header"> | ||
<div class="input-group"> | ||
<SearchIcon/> | ||
<input | ||
type="text" | ||
class="form-control form-control-sm" | ||
v-model="search" | ||
placeholder="Search" | ||
autocomplete="off" | ||
/> | ||
</div> | ||
</div> | ||
</li> | ||
<li v-for="asset in filteredItems" :key="asset"> | ||
<a class="dropdown-item" | ||
href="#" | ||
@click="selectItem(asset)"> | ||
<div class="dropdown-item-asset-item"> | ||
<img | ||
:src="getAssetIcon(asset)" | ||
class="asset-icon" | ||
/> | ||
{{ asset }} | ||
</div> | ||
</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { | ||
getAssetColorStyle, | ||
getAssetIcon | ||
} from '@/utils/asset' | ||
import SearchIcon from '@/assets/icons/search.svg' | ||
export default { | ||
components: { | ||
SearchIcon | ||
}, | ||
props: ['assets', 'initialSelected'], | ||
data () { | ||
return { | ||
selectedAsset: this.initialSelected, | ||
dropdownOpen: false, | ||
search: '', | ||
filteredItems: [] | ||
} | ||
}, | ||
computed: { | ||
items () { | ||
return this.assets.filter(a => a !== this.selectedAsset) | ||
} | ||
}, | ||
watch: { | ||
serach: function (newSearch, oldSearch) { | ||
if (newSearch && newSearch !== oldSearch) { | ||
this.filteredItems = this.items.filter( | ||
a => a.toUpperCase().includes(newSearch.toUpperCase()) | ||
) | ||
} else { | ||
this.filteredItems = [...this.items] | ||
} | ||
} | ||
}, | ||
methods: { | ||
getAssetColorStyle, | ||
getAssetIcon, | ||
selectItem (asset) { | ||
this.selectedAsset = asset | ||
this.$emit('asset-changed', asset) | ||
this.dropdownOpen = false | ||
}, | ||
toogle () { | ||
console.log('on toogle', this.items) | ||
this.dropdownOpen = !this.dropdownOpen | ||
} | ||
}, | ||
created () { | ||
this.filteredItems = [...this.items] | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss"> | ||
.asset-list-search { | ||
.dropdown-menu { | ||
width: 215px; | ||
border-radius: 0; | ||
padding: 10px 0; | ||
margin: 0; | ||
.dropdown-header { | ||
padding-left: 15px; | ||
padding-right: 15px; | ||
.input-group { | ||
align-items: center; | ||
svg { | ||
position: absolute; | ||
left: 0; | ||
top: 5px; | ||
width: 16px; | ||
margin-right: 8px; | ||
} | ||
} | ||
} | ||
.dropdown-item { | ||
padding: 0.25rem 0; | ||
border-bottom: 1px solid $hr-border-color; | ||
.dropdown-item-asset-item { | ||
padding: 0 15px; | ||
img { | ||
margin-right: 5px; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
</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
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
Oops, something went wrong.