telosnetwork / telos-wallet

Native & EVM Web Wallet for transfers, staking, digital collectibles, and more
https://wallet.telos.net
Apache License 2.0
9 stars 8 forks source link

Refactoring - move a set of usefull auxiliary functions to a new utils.ts file #248

Closed Viterbo closed 10 months ago

Viterbo commented 1 year ago

Description

Currently, we are displaying amounts, balances, and numbers in different formats on the Balances page mockup. Those formats are powered by very useful auxiliary functions that are currently part of a component, therefore they are not importable from other places. Also, they are too app-specific to be placed inside the generic library.

Acceptance Criteria

The new set of solutions should include as parameters the properties taken from the component as this.propertyName. The resulting code should be placed outside the library folder because they are too app-specific.

Candidates to be refactored

fiatRateText() // (@ $0.7732 / STLOS) https://github.com/telosnetwork/telos-wallet/blob/dcbccf75dbbb6917657577448dce36c985d5a993/src/pages/evm/wallet/WalletBalanceRow.vue#L88-L105

prettyPrimaryAmount() https://github.com/telosnetwork/telos-wallet/blob/dcbccf75dbbb6917657577448dce36c985d5a993/src/pages/evm/wallet/WalletBalanceRow.vue#L118-L140

overflowMenuItems() https://github.com/telosnetwork/telos-wallet/blob/dcbccf75dbbb6917657577448dce36c985d5a993/src/pages/evm/wallet/WalletBalanceRow.vue#L199-L259

Evaluate the migration of all of them.

Viterbo commented 10 months ago

This issue is not applicable anymore. All the the referenced code is has changed since.