From faa1e32b556ca0d20c44869ca228e267f8e03eb5 Mon Sep 17 00:00:00 2001 From: Yulia Hermak Date: Sat, 9 Dec 2023 04:49:00 +0000 Subject: [PATCH 1/3] feat: use ellipsis sing for addresses --- src/components/TransactionListItem.vue | 32 ++++++++++-- src/components/WalletCard.vue | 20 ++++++- .../transactions/TransactionTemplate.vue | 52 ++++++++++++++++--- 3 files changed, 92 insertions(+), 12 deletions(-) diff --git a/src/components/TransactionListItem.vue b/src/components/TransactionListItem.vue index d0cd99ac1..b8c1a57ff 100644 --- a/src/components/TransactionListItem.vue +++ b/src/components/TransactionListItem.vue @@ -12,11 +12,14 @@ - {{ partnerName }} - ({{ partnerId }}) + {{ partnerName }} + ({{ address }}) - {{ partnerId }} + + {{ addressLeft }} + {{ addressRight }} + @@ -117,6 +120,17 @@ export default { partnerId() { return isStringEqualCI(this.senderId, this.userId) ? this.recipientId : this.senderId }, + addressLeft() { + return this.partnerId.substring(0, this.partnerId.length - 10) + }, + addressRight() { + return this.partnerId.substring(this.partnerId.length - 10) + }, + address() { + return this.partnerId.length > 20 + ? this.partnerId.slice(0, 16) + '...' + this.addressRight + : this.partnerId + }, // Partner's ADM address, if found. Else, returns 'undefined' partnerAdmId() { const admTx = this.getAdmTx @@ -245,6 +259,18 @@ export default { @import '@/assets/styles/themes/adamant/_mixins.scss'; @import '@/assets/styles/settings/_colors.scss'; +.addressLeft { + display: inline-block; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.addressRight { + display: inline-block; +} +.a-text-regular-enlarged { + display: flex; +} .transaction-item { &__rates { color: hsla(0, 0%, 100%, 0.7); diff --git a/src/components/WalletCard.vue b/src/components/WalletCard.vue index 6cf6d02a2..676b0494d 100644 --- a/src/components/WalletCard.vue +++ b/src/components/WalletCard.vue @@ -6,7 +6,8 @@ {{ $t('home.wallet_crypto', { crypto: cryptoName }) }} - {{ address }} +
{{ addressLeft }}
+
{{ addressRight }}
- -
- {{ recipientFormatted || placeholder }} +
+
+
{{ recipientLeft }}
+
{{ recipientRight }}
+
+
+
+ {{ placeholder }}
@@ -325,6 +337,18 @@ export default { }, rate() { return this.$store.getters['rate/rate'](this.amountNumber, this.crypto) + }, + senderLeft() { + return this.senderFormatted.substring(0, this.senderFormatted.length - 10) + }, + senderRight() { + return this.senderFormatted.substring(this.senderFormatted.length - 10) + }, + recipientLeft() { + return this.recipientFormatted.substring(0, this.recipientFormatted.length - 10) + }, + recipientRight() { + return this.recipientFormatted.substring(this.recipientFormatted.length - 10) } }, watch: { @@ -393,6 +417,7 @@ export default { .transaction-view { &__title { + margin-right: 16px; font-weight: 300; } &__titlecontent { @@ -407,6 +432,19 @@ export default { max-width: 100%; width: 100%; } + &__address { + display: flex; + justify-content: flex-end; + } + &__left { + display: inline-block; + white-space: nowrap; /* Запрещаем перенос строк */ + overflow: hidden; /* Обрезаем все, что не помещается в область */ + text-overflow: ellipsis; + } + &__right { + display: inline-block; + } &__toolbar { :deep(.v-toolbar__title) div { text-overflow: ellipsis; From 9ae35e3608f208f030d2005a9b230e5752f30727 Mon Sep 17 00:00:00 2001 From: Yulia Hermak Date: Sat, 9 Dec 2023 04:52:47 +0000 Subject: [PATCH 2/3] refactor: descriptive words --- src/components/WalletCard.vue | 4 ++-- src/components/transactions/TransactionTemplate.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/WalletCard.vue b/src/components/WalletCard.vue index 676b0494d..d3e4e4cde 100644 --- a/src/components/WalletCard.vue +++ b/src/components/WalletCard.vue @@ -130,8 +130,8 @@ export default { } &__addressLeft { display: inline-block; - white-space: nowrap; /* Запрещаем перенос строк */ - overflow: hidden; /* Обрезаем все, что не помещается в область */ + white-space: nowrap; + overflow: hidden; text-overflow: ellipsis; } &__addressRight { diff --git a/src/components/transactions/TransactionTemplate.vue b/src/components/transactions/TransactionTemplate.vue index b882697a4..2aa79384b 100644 --- a/src/components/transactions/TransactionTemplate.vue +++ b/src/components/transactions/TransactionTemplate.vue @@ -438,8 +438,8 @@ export default { } &__left { display: inline-block; - white-space: nowrap; /* Запрещаем перенос строк */ - overflow: hidden; /* Обрезаем все, что не помещается в область */ + white-space: nowrap; + overflow: hidden; text-overflow: ellipsis; } &__right { From 21e3ef441752b7a82d067be0c4128ad91ed4a717 Mon Sep 17 00:00:00 2001 From: Yulia Hermak Date: Sun, 24 Mar 2024 22:00:47 +0000 Subject: [PATCH 3/3] fix: new component TextTrimmer --- src/components/TextTrimmer.vue | 106 +++++++++++++++++++++++++++++++++ src/components/WalletCard.vue | 5 +- 2 files changed, 109 insertions(+), 2 deletions(-) create mode 100644 src/components/TextTrimmer.vue diff --git a/src/components/TextTrimmer.vue b/src/components/TextTrimmer.vue new file mode 100644 index 000000000..a3fc86b91 --- /dev/null +++ b/src/components/TextTrimmer.vue @@ -0,0 +1,106 @@ + + + + + diff --git a/src/components/WalletCard.vue b/src/components/WalletCard.vue index d3e4e4cde..5f519a668 100644 --- a/src/components/WalletCard.vue +++ b/src/components/WalletCard.vue @@ -6,8 +6,7 @@ {{ $t('home.wallet_crypto', { crypto: cryptoName }) }} -
{{ addressLeft }}
-
{{ addressRight }}
+