Skip to content

Commit b31fc36

Browse files
committed
Swap details
1 parent 45569f4 commit b31fc36

File tree

10 files changed

+545
-253
lines changed

10 files changed

+545
-253
lines changed

src/components/FeeSelector.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@
1111
</template>
1212

1313
<script>
14-
import { mapGetters } from 'vuex'
1514
import cryptoassets from '@liquality/cryptoassets'
1615
1716
export default {
1817
props: ['asset', 'value', 'fees'],
1918
methods: {
20-
...mapGetters(['client']),
2119
getTooltip (name) {
2220
const unit = cryptoassets[this.asset.toLowerCase()].fees.unit
2321
let content = `${this.fees[name].fee} ${unit}`

src/components/HistoryModal.vue

Lines changed: 0 additions & 184 deletions
This file was deleted.

src/components/NavBar.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export default {
7979
}
8080
8181
&_menu {
82-
right: 14px;
82+
right: $wrapper-padding;
8383
&_icon {
8484
float: right;
8585
width: 18px;
@@ -93,12 +93,12 @@ export default {
9393
9494
li {
9595
justify-content: start;
96-
padding: 7px 20px;
96+
padding: 7px $wrapper-padding;
9797
}
9898
9999
svg {
100100
height: 18px;
101-
width: 20px;
101+
width: $wrapper-padding;
102102
object-fit: cover;
103103
margin-right: 6px;
104104
}
@@ -111,7 +111,7 @@ export default {
111111
}
112112
113113
&_prev {
114-
left: 14px;
114+
left: $wrapper-padding;
115115
&_icon {
116116
margin-right: 7px;
117117
margin-top: 3px;

src/components/Transaction.vue

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div :class="{
33
transaction: true,
44
'text-danger': !!error
5-
}" @click="$emit('click')">
5+
}">
66
<div class="transaction_icon">
77
<SendIcon v-if="type ==='SEND'" class="transaction_icon_send" />
88
<ReceiveIcon v-if="type ==='RECEIVE'" class="transaction_icon_receive" />
@@ -23,17 +23,14 @@
2323
</template>
2424

2525
<script>
26-
import moment from 'moment/min/moment-with-locales'
26+
import moment from '@/utils/moment'
2727
import cryptoassets from '@liquality/cryptoassets'
2828
import SendIcon from '@/assets/icons/arrow_send.svg'
2929
import ReceiveIcon from '@/assets/icons/arrow_receive.svg'
3030
import SwapIcon from '@/assets/icons/arrow_swap.svg'
3131
import CompletedIcon from '@/assets/icons/completed.svg'
3232
import SpinnerIcon from '@/assets/icons/spinner.svg'
3333
34-
const locale = window.navigator.userLanguage || window.navigator.language
35-
moment.locale(locale)
36-
3734
export default {
3835
components: {
3936
SendIcon,
@@ -81,6 +78,7 @@ export default {
8178
"icon time detail status";
8279
align-items: center;
8380
font-size: $font-size-sm;
81+
color: $color-text-primary;
8482
8583
&_icon {
8684
grid-area: icon;
@@ -118,7 +116,7 @@ export default {
118116
&_time {
119117
grid-area: time;
120118
font-size: $font-size-tiny;
121-
color: #646F85;;
119+
color: $color-text-muted;
122120
}
123121
124122
&_amount {
@@ -128,7 +126,7 @@ export default {
128126
129127
&_detail {
130128
grid-area: detail;
131-
color: #646F85;;
129+
color: $color-text-muted;
132130
text-align: right;
133131
}
134132

src/router/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import UnlockWallet from '@/views/UnlockWallet.vue'
88
import BackupWallet from '@/views/BackupWallet.vue'
99
import Wallet from '@/views/Wallet.vue'
1010
import Account from '@/views/Account.vue'
11+
import TransactionDetails from '@/views/TransactionDetails.vue'
1112
import Send from '@/views/Send.vue'
1213
import SendConfirm from '@/views/SendConfirm.vue'
1314
import Receive from '@/views/Receive.vue'
@@ -52,6 +53,12 @@ const routes = [
5253
component: Account,
5354
props: true
5455
},
56+
{
57+
name: 'Transaction',
58+
path: '/tx/:id',
59+
component: TransactionDetails,
60+
props: true
61+
},
5562
{
5663
path: '/account/:asset/send',
5764
component: Send,

src/utils/asset.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,19 @@ export const getAssetColorStyle = asset => {
1010
const assetData = cryptoassets[asset.toLowerCase()]
1111
if (assetData.color) return { color: assetData.color }
1212
}
13+
14+
const EXPLORERS = {
15+
ETH: {
16+
testnet: 'https://rinkeby.etherscan.io/tx/0x',
17+
mainnet: 'https://etherscan.io/tx/0x'
18+
},
19+
BTC: {
20+
testnet: 'https://blockstream.info/tx/',
21+
mainnet: 'https://blockstream.info/testnet/tx/'
22+
}
23+
}
24+
25+
export const getExplorerLink = (hash, asset, network) => {
26+
const chain = getChainFromAsset(asset)
27+
return `${EXPLORERS[chain][network]}${hash}`
28+
}

src/utils/moment.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import moment from 'moment/min/moment-with-locales'
2+
3+
const locale = window.navigator.userLanguage || window.navigator.language
4+
moment.locale(locale)
5+
6+
export default moment

src/utils/order.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
export const ORDER_STATUS_STEP_MAP = {
2+
QUOTE: 1,
3+
SECRET_READY: 1,
4+
INITIATED: 1,
5+
INITIATION_REPORTED: 2,
6+
WAITING_FOR_CONFIRMATIONS: 3,
7+
READY_TO_CLAIM: 3,
8+
WAITING_FOR_CLAIM_CONFIRMATIONS: 3,
9+
GET_REFUND: 3,
10+
WAITING_FOR_REFUND_CONFIRMATIONS: 3,
11+
READY_TO_SEND: 4
12+
}
13+
14+
export const ORDER_STATUS_LABEL_MAP = {
15+
QUOTE: 'Initiating',
16+
SECRET_READY: 'Initiating',
17+
INITIATED: 'Pending Agent',
18+
INITIATION_REPORTED: 'Pending Agent',
19+
WAITING_FOR_CONFIRMATIONS: 'Pending Agent',
20+
READY_TO_CLAIM: 'Claiming',
21+
WAITING_FOR_CLAIM_CONFIRMATIONS: 'Claiming',
22+
GET_REFUND: 'Refunding',
23+
WAITING_FOR_REFUND_CONFIRMATIONS: 'Refunding',
24+
REFUNDED: 'Refunded',
25+
SUCCESS: 'Completed',
26+
READY_TO_SEND: 'Sending'
27+
}

0 commit comments

Comments
 (0)