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

[DDW-694] Implement the Tokens screen #2671

Merged
merged 66 commits into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
75bc2fa
[DDW-694] Initial file structure
thedanheller Sep 13, 2021
fa917a4
[DDW-694] Improve file structure
thedanheller Sep 13, 2021
0caff21
[DDW-694] CHANGELOG
thedanheller Sep 13, 2021
4d23d51
[DDW-694] Search init
thedanheller Sep 13, 2021
20a51b2
Merge branch 'develop' into feature/ddw-694-implement-tokens-tab
nikolaglumac Sep 14, 2021
9feb5b7
[DDW-694] Fix Assets search
thedanheller Sep 14, 2021
2ee90af
[DDW-694] Fix Assets dropdown search
thedanheller Sep 14, 2021
eb3e3a2
[DDW-694] Tokens list - progress
thedanheller Sep 14, 2021
972252f
[DDW-694] Storybook stories
thedanheller Sep 15, 2021
5f5b8f2
[DDW-694] Storybook stories
thedanheller Sep 15, 2021
0264ce5
[DDW-694] Tokens List Header - init
thedanheller Sep 15, 2021
4c4d9cf
[DDW-694] Tokens List Header - progress
thedanheller Sep 15, 2021
4ba5509
[DDW-694] Tokens List Header - progress
thedanheller Sep 15, 2021
4272867
[DDW-694] Tokens List Header - progress
thedanheller Sep 15, 2021
836248d
[DDW-694] Remove controls for the MVP scope
thedanheller Sep 16, 2021
e8f5685
[DDW-694] Remove controls for the MVP scope
thedanheller Sep 16, 2021
d157887
[DDW-694] Favorite - init
thedanheller Sep 16, 2021
dff8026
[DDW-694] Favorites localstorage
thedanheller Sep 16, 2021
3757cb2
[DDW-694] Styling adjustments
thedanheller Sep 17, 2021
308b7c1
[DDW-694] Styling adjustments
thedanheller Sep 17, 2021
eb6eb8a
[DDW-694] Styling adjustments
thedanheller Sep 17, 2021
97795af
[DDW-694] Favorites working
thedanheller Sep 17, 2021
54dcb37
[DDW-694] Only recent tokens
thedanheller Sep 17, 2021
da45f20
Merge branch 'develop' into feature/ddw-694-implement-tokens-tab
thedanheller Sep 17, 2021
9547699
[DDW-694] Toggle favorite animation
thedanheller Sep 20, 2021
c146ba7
[DDW-694] Show Zero Tokens - init
thedanheller Sep 20, 2021
01a2ff9
[DDW-694] Move animation to the specific component using it
thedanheller Sep 21, 2021
c66d303
[DDW-694] Move animation to the specific component using it
thedanheller Sep 21, 2021
bb526d3
[DDW-694] View all tokens button
thedanheller Sep 21, 2021
7f69ee6
[DDW-694] Translation manager
thedanheller Sep 21, 2021
87700e2
[DDW-694] Sorting - init
thedanheller Sep 21, 2021
43f3413
[DDW-694] Wallet Tokens sorting
thedanheller Sep 21, 2021
4c1cd1b
[DDW-694] Fix memoized token dependency
thedanheller Sep 21, 2021
c2013f2
[DDW-694] Fix memoized token dependency
thedanheller Sep 21, 2021
6e01c59
[DDW-694] Move sort fn into utils
thedanheller Sep 22, 2021
07208e0
[DDW-694] Adjust column title position
thedanheller Sep 22, 2021
004b023
[DDW-694] Sorting and animation tweaks
thedanheller Sep 22, 2021
97c7293
[DDW-694] JP translation
thedanheller Sep 23, 2021
b9a7c57
[DDW-694] Preparing for translation
thedanheller Sep 23, 2021
576b7c7
[DDW-694] JP translation and adjustments
thedanheller Sep 23, 2021
b01154d
[DDW-694] Adjustments
thedanheller Sep 23, 2021
dc0659f
[DDW-694] Adjustments
thedanheller Sep 23, 2021
39eb6bf
[DDW-694] Adjustments
thedanheller Sep 23, 2021
4b9cd75
[DDW-694] Add mistakenly removed flow to Routes
thedanheller Sep 23, 2021
8578834
[DDW-694] Remove unused type
thedanheller Sep 23, 2021
e93b2b4
[DDW-694] Fix variables naming
thedanheller Sep 23, 2021
bc9cff5
[DDW-694] Fix variables naming
thedanheller Sep 23, 2021
15be076
Merge branch 'develop' into feature/ddw-694-implement-tokens-tab
thedanheller Sep 27, 2021
4fcddfd
[DDW-694] Styling adjustment
thedanheller Sep 28, 2021
1a1c485
[DDW-694] Add hooks to Func Component functions
thedanheller Sep 28, 2021
4a61e11
Merge branch 'develop' into feature/ddw-694-implement-tokens-tab
thedanheller Oct 1, 2021
24adfc8
[DDW-694] Wallet Summary tokens adjustments and fns docs
thedanheller Oct 1, 2021
3e73df7
[DDW-694] Fix toggle sort direction
thedanheller Oct 1, 2021
bb7a2d4
[DDW-694] Restoring state for the Tokens tab
thedanheller Oct 1, 2021
06afac6
[DDW-694] Fix search not working
thedanheller Oct 1, 2021
119c8bb
[DDW-694] Styling adjustments
thedanheller Oct 4, 2021
d7d4e9a
[DDW-694] Disable send when token has zero balance
thedanheller Oct 4, 2021
baf7264
[DDW-694] No Tokens scenario in the Tokens tab
thedanheller Oct 4, 2021
d229671
[DDW-694] No Tokens scenario in the Tokens tab - fix typo
thedanheller Oct 4, 2021
cce0ea2
[DDW-694] Remove zero tokens from the scope
thedanheller Oct 5, 2021
910344b
[DDW-694] Sort qtd with formatted amount
thedanheller Oct 6, 2021
d610739
Merge branch 'develop' into feature/ddw-694-implement-tokens-tab
thedanheller Oct 6, 2021
479476f
[DDW-694] Fix CHANGELOG
thedanheller Oct 6, 2021
68e78fc
[DDW-694] Proper flow typing
thedanheller Oct 6, 2021
4acee7c
[DDW-694] Merges develop
nikolaglumac Oct 8, 2021
3fb7d98
[DDW-694] useMemo in main content functions
thedanheller Oct 8, 2021
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## vNext

### Features

- Implemented the wallet Tokens dedicated screen ([PR 2671](https://github.com/input-output-hk/daedalus/pull/2671))

### Fixes

- Fixed wallet settings screen - no space at the bottom when scrolled down ([PR 2686](https://github.com/input-output-hk/daedalus/pull/2686))
Expand Down
1 change: 1 addition & 0 deletions source/common/config/electron-store.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const STORAGE_KEYS: {
STAKING_INFO_WAS_OPEN: 'ALONZO-INFO-WAS-OPEN',
TERMS_OF_USE_ACCEPTANCE: 'TERMS-OF-USE-ACCEPTANCE',
THEME: 'THEME',
TOKEN_FAVORITES: 'TOKEN-FAVORITES',
USER_DATE_FORMAT_ENGLISH: 'USER-DATE-FORMAT-ENGLISH',
USER_DATE_FORMAT_JAPANESE: 'USER-DATE-FORMAT-JAPANESE',
USER_LOCALE: 'USER-LOCALE',
Expand Down
1 change: 1 addition & 0 deletions source/common/types/electron-store.types.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export type StorageKey =
| 'SMASH-SERVER'
| 'TERMS-OF-USE-ACCEPTANCE'
| 'THEME'
| 'TOKEN-FAVORITES'
| 'USER-DATE-FORMAT-ENGLISH'
| 'USER-DATE-FORMAT-JAPANESE'
| 'USER-LOCALE'
Expand Down
10 changes: 6 additions & 4 deletions source/renderer/app/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import WalletSummaryPage from './containers/wallet/WalletSummaryPage';
import WalletSendPage from './containers/wallet/WalletSendPage';
import WalletReceivePage from './containers/wallet/WalletReceivePage';
import WalletTransactionsPage from './containers/wallet/WalletTransactionsPage';
import WalletTokensPage from './containers/wallet/WalletTokensPage';
import WalletSettingsPage from './containers/wallet/WalletSettingsPage';
import WalletUtxoPage from './containers/wallet/WalletUtxoPage';
import VotingRegistrationPage from './containers/voting/VotingRegistrationPage';
Expand Down Expand Up @@ -64,15 +65,16 @@ export const Routes = withRouter(() => (
path={ROUTES.WALLETS.SUMMARY}
component={WalletSummaryPage}
/>
<Route
path={ROUTES.WALLETS.TRANSACTIONS}
component={WalletTransactionsPage}
/>
<Route path={ROUTES.WALLETS.SEND} component={WalletSendPage} />
<Route
path={ROUTES.WALLETS.RECEIVE}
component={WalletReceivePage}
/>
<Route path={ROUTES.WALLETS.TOKENS} component={WalletTokensPage} />
<Route
path={ROUTES.WALLETS.TRANSACTIONS}
component={WalletTransactionsPage}
/>
<Route
path={ROUTES.WALLETS.SETTINGS}
component={WalletSettingsPage}
Expand Down
10 changes: 10 additions & 0 deletions source/renderer/app/actions/assets-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,14 @@ export default class AssetsActions {
decimals: number,
}> = new Action();
onAssetSettingsCancel: Action<any> = new Action();
onOpenAssetSend: Action<{ uniqueId: string }> = new Action();
onCopyAssetParam: Action<{ param: string, fullValue: string }> = new Action();
onToggleFavorite: Action<{
uniqueId: string,
isFavorite: boolean,
}> = new Action();
copyAssetParamNotification: Action<{
param: string,
shortValue: string,
}> = new Action();
}
1 change: 0 additions & 1 deletion source/renderer/app/actions/wallets-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ export default class WalletsActions {
copyWalletPublicKey: Action<{ publicKey: string }> = new Action();
copyICOPublicKey: Action<{ publicKey: string }> = new Action();
copyAddress: Action<{ address: string }> = new Action();
copyAssetItem: Action<{ assetItem: string, value: string }> = new Action();
updateCertificateStep: Action<any> = new Action();
closeCertificateGeneration: Action<any> = new Action();
closeRewardsCsvGeneration: Action<any> = new Action();
Expand Down
2 changes: 1 addition & 1 deletion source/renderer/app/api/assets/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ export type AssetToken = {

export type AssetMetadata = {
name: string,
ticker: string,
description: string,
ticker?: string,
decimals?: number, // [0 .. 255]
url?: string,
logo?: string,
Expand Down
25 changes: 25 additions & 0 deletions source/renderer/app/api/utils/localStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,31 @@ export default class LocalStorageApi {
unsetAppUpdateCompleted = (): Promise<void> =>
LocalStorageApi.unset(keys.APP_UPDATE_COMPLETED);

getWalletTokenFavorites = (): Promise<{ [key: string]: boolean }> =>
LocalStorageApi.get(keys.TOKEN_FAVORITES, {});
nikolaglumac marked this conversation as resolved.
Show resolved Hide resolved

toggleWalletTokenFavorite = async (
uniqueId: string,
isFavorite: boolean
): Promise<boolean> => {
const favorites = await this.getWalletTokenFavorites();
const newFavorites = {
...favorites,
[uniqueId]: isFavorite,
};
await LocalStorageApi.set(keys.TOKEN_FAVORITES, newFavorites);
return !isFavorite;
};

unsetWalletTokenFavorite = async (uniqueId: string): Promise<void> => {
const favorites = await this.getWalletTokenFavorites();
delete favorites[uniqueId];
await LocalStorageApi.set(keys.TOKEN_FAVORITES, favorites);
};

unsetWalletTokenFavorites = async (): Promise<void> =>
LocalStorageApi.unset(keys.TOKEN_FAVORITES);

getAssetsLocalData = (): Promise<AssetLocalData> =>
LocalStorageApi.get(keys.ASSET_DATA, []);

Expand Down
3 changes: 3 additions & 0 deletions source/renderer/app/assets/images/star-filled.inline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions source/renderer/app/assets/images/star-not-filled.inline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions source/renderer/app/components/assets/Asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,37 @@ import type { Asset as AssetProps } from '../../api/assets/types';

const messages = defineMessages({
fingerprintItem: {
id: 'assets.assetToken.item.fingerprint',
id: 'assets.assetToken.param.fingerprint',
defaultMessage: '!!!Fingerprint',
description: '"fingerprint" item.',
},
policyIdItem: {
id: 'assets.assetToken.item.policyId',
id: 'assets.assetToken.param.policyId',
defaultMessage: '!!!Policy Id',
description: '"policyId" item.',
},
assetNameItem: {
id: 'assets.assetToken.item.assetName',
id: 'assets.assetToken.param.assetName',
defaultMessage: '!!!Asset name',
description: '"assetName" item.',
},
nameItem: {
id: 'assets.assetToken.item.name',
id: 'assets.assetToken.param.name',
defaultMessage: '!!!Name',
description: '"name" item.',
},
tickerItem: {
id: 'assets.assetToken.item.ticker',
id: 'assets.assetToken.param.ticker',
defaultMessage: '!!!Ticker',
description: '"ticker" item.',
},
descriptionItem: {
id: 'assets.assetToken.item.description',
id: 'assets.assetToken.param.description',
defaultMessage: '!!!Description',
description: '"description" item.',
},
blank: {
id: 'assets.assetToken.item.blank',
id: 'assets.assetToken.param.blank',
defaultMessage: '!!!Blank',
description: '"Blank" item value.',
},
Expand Down Expand Up @@ -74,7 +74,7 @@ type Props = {
asset: AssetProps,
small?: boolean,
hidePopOver?: boolean,
onCopyAssetItem?: Function,
onCopyAssetParam?: Function,
onClickSettings?: Function,
assetSettingsDialogWasOpened?: ?boolean,
anyAssetWasHovered?: ?boolean,
Expand Down Expand Up @@ -221,15 +221,15 @@ export default class Asset extends Component<Props, State> {
renderPillPopOverContainer = () => {
const {
asset,
onCopyAssetItem,
onCopyAssetParam,
assetSettingsDialogWasOpened,
anyAssetWasHovered,
} = this.props;
const pillContent = this.renderPillContent();
const popOverContent = (
<AssetContent
asset={asset}
onCopyAssetItem={onCopyAssetItem}
onCopyAssetParam={onCopyAssetParam}
assetSettingsDialogWasOpened={assetSettingsDialogWasOpened}
anyAssetWasHovered={anyAssetWasHovered}
className={styles.popOverContent}
Expand Down
Loading