Skip to content

Commit 2a37312

Browse files
[DDW-852] Improve Stake Pools list view attention (#2847)
Co-authored-by: Daniel Main <[email protected]>
1 parent 53f75cc commit 2a37312

File tree

12 files changed

+290
-196
lines changed

12 files changed

+290
-196
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## vNext
4+
5+
### Features
6+
- Improved stake pool searchbar ([PR 2847](https://github.com/input-output-hk/daedalus/pull/2847))
7+
38
## 4.9.0-FC1
49

510
### Features

source/common/config/electron-store.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const STORAGE_KEYS: Record<string, StorageKey> = {
2020
READ_NEWS: 'READ-NEWS',
2121
RESET: 'RESET',
2222
SMASH_SERVER: 'SMASH-SERVER',
23+
STAKE_POOLS_LIST_VIEW_TOOLTIP: 'STAKE-POOLS-LIST-VIEW-TOOLTIP',
2324
STAKING_INFO_WAS_OPEN: 'ALONZO-INFO-WAS-OPEN',
2425
TERMS_OF_USE_ACCEPTANCE: 'TERMS-OF-USE-ACCEPTANCE',
2526
THEME: 'THEME',

source/common/types/electron-store.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export type StorageKey =
1515
| 'READ-NEWS'
1616
| 'RESET'
1717
| 'SMASH-SERVER'
18+
| 'STAKE-POOLS-LIST-VIEW-TOOLTIP'
1819
| 'TERMS-OF-USE-ACCEPTANCE'
1920
| 'THEME'
2021
| 'TOKEN-FAVORITES'

source/main/ipc/electronStoreConversation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const reset = async () => {
3737
await unset(keys.READ_NEWS);
3838
await unset(keys.SMASH_SERVER);
3939
await unset(keys.STAKING_INFO_WAS_OPEN);
40+
await unset(keys.STAKE_POOLS_LIST_VIEW_TOOLTIP);
4041
await unset(keys.TERMS_OF_USE_ACCEPTANCE);
4142
await unset(keys.THEME);
4243
await unset(keys.USER_DATE_FORMAT_ENGLISH);

source/renderer/app/api/utils/localStorage.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,12 @@ export default class LocalStorageApi {
398398
LocalStorageApi.unset(keys.HARDWARE_WALLET_DEVICES, deviceId);
399399
unsetHardwareWalletDevicesAll = async (): Promise<void> =>
400400
LocalStorageApi.unset(keys.HARDWARE_WALLET_DEVICES);
401+
setStakePoolsListViewTooltip = async (visited: boolean): Promise<void> =>
402+
LocalStorageApi.set(keys.STAKE_POOLS_LIST_VIEW_TOOLTIP, visited);
403+
getStakePoolsListViewTooltip = async (): Promise<boolean> =>
404+
LocalStorageApi.get(keys.STAKE_POOLS_LIST_VIEW_TOOLTIP, true);
405+
unsetStakePoolsListViewTooltip = async (): Promise<void> =>
406+
LocalStorageApi.unset(keys.STAKE_POOLS_LIST_VIEW_TOOLTIP);
401407
reset = async () => {
402408
await LocalStorageApi.reset();
403409
};

source/renderer/app/components/staking/stake-pools/StakePools.tsx

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,24 +71,26 @@ const messages = defineMessages({
7171
});
7272
const SELECTED_INDEX_TABLE = 'selectedIndexTable';
7373
type Props = {
74-
wallets: Array<Wallet>;
7574
currentLocale: string;
76-
stakePoolsList: Array<StakePool>;
77-
onOpenExternalLink: (...args: Array<any>) => any;
7875
currentTheme: string;
79-
updateDelegatingStake: (...args: Array<any>) => any;
80-
rankStakePools: (...args: Array<any>) => any;
81-
selectedDelegationWalletId?: string | null | undefined;
82-
stake?: number | null | undefined;
83-
onDelegate: (...args: Array<any>) => any;
84-
isLoading: boolean;
76+
getStakePoolById: (...args: Array<any>) => any;
8577
isFetching: boolean;
78+
isListViewTooltipVisible?: boolean;
79+
isLoading: boolean;
8680
isRanking: boolean;
87-
stakePoolsDelegatingList: Array<StakePool>;
88-
getStakePoolById: (...args: Array<any>) => any;
81+
maxDelegationFunds: number;
82+
onDelegate: (...args: Array<any>) => any;
83+
onListViewVisited: () => void;
84+
onOpenExternalLink: (...args: Array<any>) => any;
8985
onSmashSettingsClick: (...args: Array<any>) => any;
86+
rankStakePools: (...args: Array<any>) => any;
87+
selectedDelegationWalletId?: string | null | undefined;
9088
smashServerUrl: string | null | undefined;
91-
maxDelegationFunds: number;
89+
stake?: number | null | undefined;
90+
stakePoolsDelegatingList: Array<StakePool>;
91+
stakePoolsList: Array<StakePool>;
92+
updateDelegatingStake: (...args: Array<any>) => any;
93+
wallets: Array<Wallet>;
9294
};
9395
type State = {
9496
search: string;
@@ -135,12 +137,13 @@ class StakePools extends Component<Props, State> {
135137
isListView: false,
136138
});
137139
};
138-
handleListView = () =>
140+
handleListView = () => {
139141
this.setState({
140142
isGridView: false,
141143
isGridRewardsView: false,
142144
isListView: true,
143145
});
146+
};
144147
handleSetListActive = (selectedList: string) =>
145148
this.setState({
146149
selectedList,
@@ -169,9 +172,11 @@ class StakePools extends Component<Props, State> {
169172
selectedDelegationWalletId,
170173
stake,
171174
onOpenExternalLink,
175+
onListViewVisited,
172176
currentTheme,
173-
isLoading,
174177
isFetching,
178+
isListViewTooltipVisible,
179+
isLoading,
175180
isRanking,
176181
stakePoolsDelegatingList,
177182
getStakePoolById,
@@ -269,7 +274,9 @@ class StakePools extends Component<Props, State> {
269274
onGridView={this.handleGridView}
270275
onGridRewardsView={this.handleGridRewardsView}
271276
onListView={this.handleListView}
277+
onListViewVisited={onListViewVisited}
272278
isListView={isListView}
279+
isListViewTooltipVisible={isListViewTooltipVisible}
273280
isGridView={isGridView}
274281
isGridRewardsView={isGridRewardsView}
275282
// @ts-ignore ts-migrate(2769) FIXME: No overload matches this call.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { defineMessages } from 'react-intl';
2+
3+
export const messages = defineMessages({
4+
searchInputPlaceholder: {
5+
id: 'staking.stakePools.search.searchInputPlaceholder',
6+
defaultMessage: '!!!Search stake pools',
7+
description: '"Delegating List Title" for the Stake Pools search.',
8+
},
9+
delegatingListTitle: {
10+
id: 'staking.stakePools.search.delegatingListTitle',
11+
defaultMessage: '!!!Stake pools to which you are delegating',
12+
description: '"delegatingListTitle" for the Stake Pools search.',
13+
},
14+
listTitle: {
15+
id: 'staking.stakePools.search.listTitle',
16+
defaultMessage: '!!!Stake pools ({pools})',
17+
description: '"listTitle" for the Stake Pools search.',
18+
},
19+
gridIconTooltip: {
20+
id: 'staking.stakePools.search.gridIconTooltip',
21+
defaultMessage: '!!!Grid View',
22+
description: '"gridIconTooltip" for the Stake Pools search.',
23+
},
24+
gridRewardsIconTooltip: {
25+
id: 'staking.stakePools.search.gridRewardsIconTooltip',
26+
defaultMessage: '!!!Grid Rewards View',
27+
description: '"gridRewardsIconTooltip" for the Stake Pools search.',
28+
},
29+
listIconTooltip: {
30+
id: 'staking.stakePools.search.listIconTooltip',
31+
defaultMessage: '!!!List View',
32+
description: '"listIconTooltip" for the Stake Pools search.',
33+
},
34+
clearTooltip: {
35+
id: 'staking.stakePools.search.clearTooltip',
36+
defaultMessage: '!!!Clear',
37+
description: '"clearTooltip" for the Stake Pools search.',
38+
},
39+
});

source/renderer/app/components/staking/stake-pools/StakePoolsSearch.scss

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
@import '../stakingConfig';
2+
13
.component {
24
background: transparent;
5+
display: flex;
36
padding: 20px 0 0;
47
position: initial;
58
transition: position 1s ease-out, top 1s ease-out;
69
width: 100%;
710
}
811

912
.container {
13+
flex: 1 1 auto;
1014
position: relative;
1115
}
1216

@@ -52,14 +56,6 @@
5256
line-height: 48px;
5357
position: absolute;
5458
right: 20px;
55-
56-
&.inputExtrasSearch {
57-
right: 110px;
58-
59-
&.withGridRewardsView {
60-
right: 145px;
61-
}
62-
}
6359
}
6460

6561
.clearSearchButton {
@@ -93,36 +89,33 @@
9389
}
9490

9591
.viewButtons {
92+
@extend %contentBorderAndBackground;
9693
align-items: center;
97-
bottom: 0.5px;
9894
display: flex;
99-
height: 48px;
95+
height: 50px;
10096
justify-content: space-between;
10197
line-height: 48px;
102-
padding-left: 20px;
103-
position: absolute;
104-
right: 11px;
98+
margin-left: 10px;
99+
padding: 0 20px;
100+
width: 118px;
105101

106-
.separator {
107-
color: var(--theme-staking-stake-pools-search-clear-button-color);
108-
opacity: 0.2;
109-
padding-right: 10px;
110-
position: relative;
111-
top: -2px;
102+
& > span {
103+
display: flex;
112104
}
113105

114106
button {
115107
border-radius: 3px;
116108
color: var(--theme-about-window-icon-close-button-color);
117109
cursor: pointer;
118-
height: 28px;
119-
margin: 0 2px;
120-
width: 28px;
110+
height: 15px;
111+
width: 15px;
121112

122113
&:hover {
123-
background-color: var(
124-
--theme-staking-stake-pools-search-clear-button-background-color
125-
);
114+
svg {
115+
> g > g {
116+
opacity: 0.7;
117+
}
118+
}
126119
}
127120

128121
svg {

0 commit comments

Comments
 (0)