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

Transaction styling #3181

Merged
merged 83 commits into from
Dec 2, 2019
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
87a1011
Transaction styling
mariopino Nov 22, 2019
3cb404f
changelog
mariopino Nov 22, 2019
d5b3818
Remove unused test, update snaps
mariopino Nov 22, 2019
6336a54
Change background tx color on hover
mariopino Nov 23, 2019
8ba5e9d
Add transition and new activity icons
mariopino Nov 23, 2019
e885e45
Add new icons
mariopino Nov 25, 2019
a63d6f0
Fix test, update snaps
mariopino Nov 25, 2019
8e0159c
Fix e2e
mariopino Nov 25, 2019
86821ed
Fix e2e
mariopino Nov 25, 2019
29137be
Update snap
mariopino Nov 25, 2019
92edf82
More testing stuff
mariopino Nov 25, 2019
b64e666
More testing and snaps
mariopino Nov 25, 2019
063e39d
More testing stuff
mariopino Nov 25, 2019
a9c4b57
Fix e2e
mariopino Nov 25, 2019
cc1c8bc
Fix e2e
mariopino Nov 25, 2019
718eac9
Trigger CI
mariopino Nov 25, 2019
cd8cc54
Fix e2e
mariopino Nov 25, 2019
fe192a8
Fix e2e
mariopino Nov 25, 2019
a35ec83
Update icons
mariopino Nov 25, 2019
5586b44
cleaning up spacing in txs, using prettyInt, dropdown animation,
jbibla Nov 26, 2019
5827fb8
Complete multisend support, cleanup
mariopino Nov 26, 2019
b83cc6a
Prevent collapse tx details when click on address
mariopino Nov 26, 2019
139d637
Fix unit test
mariopino Nov 26, 2019
4b64b62
Simplify TransactionIcon, fix test and update snap
mariopino Nov 26, 2019
5857387
more testing
mariopino Nov 26, 2019
ba3cef0
Cleanup
mariopino Nov 26, 2019
ff85c94
Update snap
mariopino Nov 26, 2019
15a4264
Add transaction metadata icons
mariopino Nov 26, 2019
758248e
Update snap
mariopino Nov 26, 2019
dd8dfd9
fix date constantly changing
Nov 27, 2019
9aaef37
More testing (not completed!)
mariopino Nov 27, 2019
e7621a7
Merge branch 'mario/3078-improve-transaction-styling' of https://gith…
mariopino Nov 27, 2019
86677e6
Complete caption, simplify
mariopino Nov 28, 2019
ac74614
Fix tests, update snaps
mariopino Nov 28, 2019
8ede20a
More testing stuff
mariopino Nov 28, 2019
4a669ae
Remove liquidDate, not supported at this moment
mariopino Nov 28, 2019
83154ad
Remove unused tx in test
mariopino Nov 28, 2019
2b98843
Lint, cleanup
mariopino Nov 28, 2019
a926e68
Fix space
mariopino Nov 28, 2019
6f6b136
Fix spaces
mariopino Nov 28, 2019
ba7fbf5
Fix spaces
mariopino Nov 28, 2019
4209221
add toggle icon
Nov 28, 2019
800a8f8
Update snaps
mariopino Nov 28, 2019
84fe561
Pass whole transaction to TransactionMetadata
mariopino Nov 29, 2019
35cb5d6
Fix test, update snap
mariopino Nov 29, 2019
beca585
Add undelegationEndTime
mariopino Nov 29, 2019
cccb94f
fix undelegationEndTime
Bitcoinera Nov 29, 2019
3af8978
Add validator image to delegate
mariopino Nov 29, 2019
41fd4c6
Merge branch 'mario/3078-improve-transaction-styling' of https://gith…
mariopino Nov 29, 2019
3c42552
Remove undelegationEndTime until merge Ana pr
mariopino Nov 29, 2019
04b122f
Add validator image to all staking tx
mariopino Nov 29, 2019
c291b4a
Cleanup
mariopino Nov 29, 2019
6682cc9
Fix e2e
mariopino Nov 29, 2019
72d11c5
add some coverage
Bitcoinera Nov 29, 2019
c745d7f
merge from remote
Bitcoinera Nov 29, 2019
200242f
fix lint error
Bitcoinera Nov 29, 2019
ddbf2a8
add again undelegationEndTime to tx request
Bitcoinera Nov 29, 2019
9076520
delete validator commission message
Bitcoinera Nov 29, 2019
e21c8ba
Remove undelegationEndTime
mariopino Nov 29, 2019
d8b1cdb
Merge branch 'develop' into mario/3078-improve-transaction-styling
mariopino Nov 29, 2019
9091342
Merge develop
mariopino Nov 29, 2019
308f2f2
made tx icon smaller on mobile and removed unneeded variables import
jbibla Nov 29, 2019
4726d1b
simplified toggle icon and added rotation transition
jbibla Nov 29, 2019
9f70b39
cleaning up styles and strange spacing / nbsp's
jbibla Nov 29, 2019
63f3f1e
added validator images for redelegations
jbibla Nov 29, 2019
48bc682
removed more unneeded nbsp's
jbibla Nov 29, 2019
ce2c192
added redelegation validator names back
jbibla Nov 29, 2019
47f21da
updated snaperoos
jbibla Nov 29, 2019
d334cc7
switched from withdraw to claimed - as is our new language
jbibla Nov 29, 2019
13dcc89
added details as subtitle on web and mobile
jbibla Nov 29, 2019
819403b
reduced css for tx component, fully responsive too
jbibla Nov 29, 2019
8462ade
tests and snaperoos
jbibla Nov 29, 2019
8af4789
removed comments and made bech32 copied element absolute so it doesn'…
jbibla Nov 29, 2019
f8f9aba
lint
jbibla Nov 29, 2019
785c417
snapshot fix
jbibla Nov 29, 2019
a51537c
Add new format to multisend tx
mariopino Nov 29, 2019
0def73d
Update snap
mariopino Nov 29, 2019
03fb1f9
Update src/scripts/transaction-utils.js
mariopino Nov 30, 2019
9e6b44d
Add new design to all tx messages
mariopino Dec 2, 2019
c66d10f
Update snaps, cleanup, comment
mariopino Dec 2, 2019
50030d9
Separate tx caption and tx type
mariopino Dec 2, 2019
a6b8241
Fix test, update snaps
mariopino Dec 2, 2019
3c2c611
Update src/scripts/transaction-utils.js
mariopino Dec 2, 2019
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
1 change: 1 addition & 0 deletions changes/mario_3078-improve-transaction-styling
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[Added] [#3078](https://github.com/cosmos/lunie/issues/3078) Improve design of Activity page and support multisend transactions @mariopino
9 changes: 9 additions & 0 deletions public/img/icons/activity/Delegate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions public/img/icons/activity/Deposit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions public/img/icons/activity/Received.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/img/icons/activity/Redelegate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/img/icons/activity/Sent.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions public/img/icons/activity/Undelegate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/img/icons/activity/Vote.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions public/img/icons/activity/Withdrawal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
167 changes: 0 additions & 167 deletions src/components/transactions/TransactionDetails.vue

This file was deleted.

51 changes: 44 additions & 7 deletions src/components/transactions/TransactionIcon.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<template>
<div class="tx__icon">
<img
:class="transactionGroup"
src="~assets/images/cosmos-logo.png"
alt="cosmic atom token"
/>
<img :class="transactionGroup" :src="icon" :alt="transactionType" />
</div>
</template>

Expand All @@ -15,6 +11,47 @@ export default {
transactionGroup: {
type: String,
required: true
},
transactionType: {
type: String,
required: true
}
},
computed: {
icon() {
if (this.transactionType === `Sent`) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you know ob the object switch approach?

const dictionary = {
  keyA: value,
  keyB: value
}

const valueForKey = dictionary[key]

Copy link
Contributor Author

@mariopino mariopino Nov 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely more cleaner but as I need to make some comparisons for Withdrawal, Vote and Deposit types like:

} else if (this.transactionType.search('Voted') === 0) {

It's possible to do that in a dictionary?

Another option is just to simplify the caption for that messages and include the info in the tx detail, then we can use a dictionary. Maybe a better solution.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks funky to me. What are the options for transactionType that there are multiple with Voted in it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I think you are on the right track. there should be an enum "transactionType" that should be different then the title.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I finally implemented that way. The icon name should be the caption string, so that way we don't need a dictionary, only need to handle Update withdraw address, which is the only specific case. A bit hacky but simplier :-)

computed: {
    icon() {
      if (this.transactionType.indexOf(` `) !== -1) {
        if (this.transactionType === `Update withdraw address`) {
          return `/img/icons/activity/Withdrawal.svg`
        } else {
          return `/img/icons/activity/${this.transactionType.substr(
            0,
            this.transactionType.indexOf(` `)
          )}.svg`
        }
      } else {
        return `/img/icons/activity/${this.transactionType}.svg`
      }
    }
  }

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am still worried, that the transactionType is the title of the transaction. If we change the title now, we need to change the name of the icon. feels like an unnecessary linkage. But we can improve later.

return `/img/icons/activity/Sent.svg`
} else if (this.transactionType === `Received`) {
return `/img/icons/activity/Received.svg`
} else if (this.transactionType === `Staked`) {
return `/img/icons/activity/Delegate.svg`
} else if (this.transactionType === `Restaked`) {
return `/img/icons/activity/Redelegate.svg`
} else if (this.transactionType === `Unstaked`) {
return `/img/icons/activity/Undelegate.svg`
} else if (this.transactionType.search(`Withdrawal`) === 0) {
return `/img/icons/activity/Withdrawal.svg`
} else if (this.transactionType === `Update withdraw address`) {
return `/img/icons/activity/Withdrawal.svg`
} else if (this.transactionType.search(`Voted`) === 0) {
return `/img/icons/activity/Voted.svg`
} else if (this.transactionType === `Deposit`) {
return `/img/icons/activity/Deposit.svg`
} else if (this.transactionType.search(`Submitted`) === 0) {
// MISSING ICON!
return `/img/icons/activity/Proposal.svg`
} else if (this.transactionType === `Create validator`) {
// MISSING ICON!
return `/img/icons/activity/Create.svg`
} else if (this.transactionType === `Edit validator`) {
// MISSING ICON!
return `/img/icons/activity/Edit.svg`
} else if (this.transactionType.search(`Unjail`) === 0) {
// MISSING ICON!
return `/img/icons/activity/Unjail.svg`
} else {
return ``
}
}
}
}
Expand All @@ -24,14 +61,14 @@ export default {
@import "../../styles/variables.css";

.tx__icon {
padding: 12px 0 12px 1rem;
padding: 1rem 0 1rem 1rem;
}

.tx__icon img {
max-height: 100%;
max-width: 52px;
border: 2px solid;
border-radius: 50%;
border: 2px solid;
display: block;
border-color: grey;
}
Expand Down
Loading