Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSS-590: Add History to the Account tab #151

Merged
merged 6 commits into from
Apr 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/lang/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ export default {
to: 'To'
},
operations: {
[Operation.Swap]: 'Swap',
[Operation.Transfer]: 'Transfer',
[Operation.AddLiquidity]: 'Add Liquidity',
[Operation.RemoveLiquidity]: 'Remove Liquidity',
[Operation.CreatePair]: 'Create Pair',
[Operation.RegisterAsset]: 'Register Asset',
[Operation.ClaimRewards]: 'Claim Rewards',
andText: 'and',
[TransactionStatus.Finalized]: {
[Operation.Transfer]: 'Sent {amount} {symbol} to {address}',
[Operation.Swap]: 'Swapped {amount} {symbol} for {amount2} {symbol2}',
Expand Down
30 changes: 16 additions & 14 deletions src/views/BridgeTransactionsHistory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@
</s-form-item>
<div class="history-items">
<template v-if="hasHistory">
<div v-for="item in filteredHistory.slice((currentPage - 1) * 10, currentPage * 10)" :key="item.id" class="history-item" :data-id="item.id || item.hash || item.ethereumHash" @click="showHistory(item.id || item.hash || item.ethereumHash)">
<div
class="history-item"
v-for="item in filteredHistory.slice((currentPage - 1) * pageAmount, currentPage * pageAmount)"
:key="`history-${item.id}`"
@click="showHistory(item.id)"
>
<div class="history-item-info">
<div class="history-item-title">{{ t('bridgeTransaction.details', {
<div class="history-item-title p4">{{ t('bridgeTransaction.details', {
from: `${item.amount} ${formatAssetSymbol(item.symbol, !isOutgoingType(item.type))}`,
to: `${item.amount} ${formatAssetSymbol(item.symbol, isOutgoingType(item.type))}`
}) }}</div>
Expand All @@ -48,6 +53,7 @@
v-if="hasHistory"
:layout="'total, prev, next'"
:current-page.sync="currentPage"
:page-size="pageAmount"
:total="filteredHistory.length"
@prev-click="handlePrevClick"
@next-click="handleNextClick"
Expand Down Expand Up @@ -110,6 +116,7 @@ export default class BridgeTransactionsHistory extends Mixins(TranslationMixin,
formatDateItem = formatDateItem
query = ''
currentPage = 1
pageAmount = 10

get filteredHistory (): Array<any> {
if (!this.history?.length) return []
Expand Down Expand Up @@ -217,7 +224,6 @@ export default class BridgeTransactionsHistory extends Mixins(TranslationMixin,
</script>

<style lang="scss">
$history-search-class: 'history--search';
.history {
&-container {
@include bridge-container;
Expand All @@ -241,25 +247,21 @@ $history-search-class: 'history--search';
}
}
}
}

.#{$history-search-class} {
.el-input__inner {
padding-right: var(--s-size-medium);
&--search {
.el-input__inner {
padding-right: var(--s-size-medium);
}
}
}
</style>

<style lang="scss" scoped>
$tooltip-area-height: var(--s-size-medium);
$tooltip-size: var(--s-size-medium);
$title-padding: calc(#{var(--s-size-medium)} + #{$inner-spacing-small});
$history-item-horizontal-space: $inner-spacing-medium;
$history-item-height: 48px;
$history-item-top-border-height: 1px;
.history {
&--search.el-form-item {
margin-bottom: $basic-spacing * 2;
margin-bottom: $inner-spacing-medium;
}
&-container {
flex-direction: column;
Expand Down Expand Up @@ -318,11 +320,11 @@ $history-item-top-border-height: 1px;
width: 100%;
}
&-title {
line-height: $s-line-height-big;
line-height: var(--s-line-height-big);
}
&-date {
color: var(--s-color-base-content-secondary);
line-height: $s-line-height-mini;
line-height: var(--s-line-height-mini);
}
@include status-icon(true);
&-icon {
Expand Down