forked from ava-labs/avalanche-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
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 ava-labs#136 from ava-labs/feat/activity_tab
Feat/activity tab
- Loading branch information
Showing
35 changed files
with
1,923 additions
and
127 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
95 changes: 95 additions & 0 deletions
95
src/components/SidePanels/History/TxHistoryValueFunctional.vue
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,95 @@ | ||
<template functional> | ||
<div class="utxo" :income="props.amount > 0"> | ||
<p class="action"> | ||
{{ $options.getActionText(props.type, props.amount, props.operationDirection) }} | ||
</p> | ||
<p | ||
class="amount" | ||
:style="{ | ||
color: $options.getColor(props.type, props.amount), | ||
}" | ||
> | ||
{{ props.amount }} | ||
<!-- {{ amountText }} {{ symbolText }}--> | ||
</p> | ||
</div> | ||
</template> | ||
<script> | ||
export default { | ||
props: { | ||
amount: Number, | ||
assetId: String, | ||
type: String, | ||
operationDirection: String, | ||
}, | ||
getColor(type, amount) { | ||
// if (this.type === 'operation') return this.operationColor | ||
if (type === 'add_validator') return '#008dc5' | ||
if (type === 'add_delegator') return '#008dc5' | ||
if (amount > 0) { | ||
return '#6BC688' | ||
} else if (amount === 0) { | ||
return '#999' | ||
} else { | ||
return '#d04c4c' | ||
} | ||
}, | ||
getActionText(type, amount, operationDirection) { | ||
let isIncome = amount > 0 | ||
switch (type) { | ||
case 'base': | ||
if (isIncome) { | ||
return 'Received' | ||
} | ||
return 'Sent' | ||
case 'operation': | ||
return operationDirection | ||
default: | ||
// Capitalize first letter | ||
return type | ||
.split('_') | ||
.map((value) => value[0].toUpperCase() + value.substring(1)) | ||
.join(' ') | ||
} | ||
}, | ||
} | ||
</script> | ||
<style scoped lang="scss"> | ||
@use '../../../main'; | ||
.utxo { | ||
display: grid; | ||
grid-template-columns: max-content 1fr; | ||
column-gap: 10px; | ||
> * { | ||
align-self: center; | ||
} | ||
&:not(:first-child) { | ||
.action { | ||
visibility: hidden; | ||
} | ||
} | ||
} | ||
.action { | ||
font-size: 12px; | ||
color: main.$primary-color-light; | ||
} | ||
.amount { | ||
text-align: right; | ||
white-space: nowrap; | ||
font-size: 15px; | ||
} | ||
@include main.medium-device { | ||
.amount { | ||
font-size: 14px; | ||
} | ||
} | ||
</style> |
Oops, something went wrong.