Skip to content

Commit

Permalink
[DDW-852] Update tooltip behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
renanvalentin committed Feb 2, 2022
1 parent 07d8fd5 commit 0f42f7e
Show file tree
Hide file tree
Showing 8 changed files with 236 additions and 161 deletions.
1 change: 1 addition & 0 deletions source/main/ipc/electronStoreConversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const reset = async () => {
await unset(keys.READ_NEWS);
await unset(keys.SMASH_SERVER);
await unset(keys.STAKING_INFO_WAS_OPEN);
await unset(keys.STAKE_POOLS_LIST_VIEW_TOOLTIP);
await unset(keys.TERMS_OF_USE_ACCEPTANCE);
await unset(keys.THEME);
await unset(keys.USER_DATE_FORMAT_ENGLISH);
Expand Down
2 changes: 2 additions & 0 deletions source/renderer/app/api/utils/localStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,8 @@ export default class LocalStorageApi {
LocalStorageApi.set(keys.STAKE_POOLS_LIST_VIEW_TOOLTIP, visited);
getStakePoolsListViewTooltip = async (): Promise<boolean> =>
LocalStorageApi.get(keys.STAKE_POOLS_LIST_VIEW_TOOLTIP, true);
unsetStakePoolsListViewTooltip = async (): Promise<void> =>
LocalStorageApi.unset(keys.STAKE_POOLS_LIST_VIEW_TOOLTIP);
reset = async () => {
await LocalStorageApi.reset();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ type Props = {
isRanking: boolean;
maxDelegationFunds: number;
onDelegate: (...args: Array<any>) => any;
onListViewClick: (...args: Array<any>) => any;
onListViewVisited: () => void;
onOpenExternalLink: (...args: Array<any>) => any;
onSmashSettingsClick: (...args: Array<any>) => any;
rankStakePools: (...args: Array<any>) => any;
Expand Down Expand Up @@ -143,7 +143,6 @@ class StakePools extends Component<Props, State> {
isGridRewardsView: false,
isListView: true,
});
this.props.onListViewClick();
};
handleSetListActive = (selectedList: string) =>
this.setState({
Expand Down Expand Up @@ -173,6 +172,7 @@ class StakePools extends Component<Props, State> {
selectedDelegationWalletId,
stake,
onOpenExternalLink,
onListViewVisited,
currentTheme,
isFetching,
isListViewTooltipVisible,
Expand Down Expand Up @@ -274,6 +274,7 @@ class StakePools extends Component<Props, State> {
onGridView={this.handleGridView}
onGridRewardsView={this.handleGridRewardsView}
onListView={this.handleListView}
onListViewVisited={onListViewVisited}
isListView={isListView}
isListViewTooltipVisible={isListViewTooltipVisible}
isGridView={isGridView}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { defineMessages } from 'react-intl';

export const messages = defineMessages({
searchInputPlaceholder: {
id: 'staking.stakePools.search.searchInputPlaceholder',
defaultMessage: '!!!Search stake pools',
description: '"Delegating List Title" for the Stake Pools search.',
},
delegatingListTitle: {
id: 'staking.stakePools.search.delegatingListTitle',
defaultMessage: '!!!Stake pools to which you are delegating',
description: '"delegatingListTitle" for the Stake Pools search.',
},
listTitle: {
id: 'staking.stakePools.search.listTitle',
defaultMessage: '!!!Stake pools ({pools})',
description: '"listTitle" for the Stake Pools search.',
},
gridIconTooltip: {
id: 'staking.stakePools.search.gridIconTooltip',
defaultMessage: '!!!Grid View',
description: '"gridIconTooltip" for the Stake Pools search.',
},
gridRewardsIconTooltip: {
id: 'staking.stakePools.search.gridRewardsIconTooltip',
defaultMessage: '!!!Grid Rewards View',
description: '"gridRewardsIconTooltip" for the Stake Pools search.',
},
listIconTooltip: {
id: 'staking.stakePools.search.listIconTooltip',
defaultMessage: '!!!List View',
description: '"listIconTooltip" for the Stake Pools search.',
},
clearTooltip: {
id: 'staking.stakePools.search.clearTooltip',
defaultMessage: '!!!Clear',
description: '"clearTooltip" for the Stake Pools search.',
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@
line-height: 48px;
position: absolute;
right: 20px;

&.inputExtrasSearch {
right: 110px;
}
}

.clearSearchButton {
Expand Down

0 comments on commit 0f42f7e

Please sign in to comment.