Skip to content

Commit 00372b5

Browse files
authored
Merge pull request #2909 from input-output-hk/fix/ddw-927-fix-search-icon-transparencies-for-different-states
2 parents 3c981a7 + b4d7265 commit 00372b5

File tree

9 files changed

+45
-17
lines changed

9 files changed

+45
-17
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
### Fixes
1111

12+
- Restored opacity for search icon when focused ([PR 2909](https://github.com/input-output-hk/daedalus/pull/2909))
1213
- Fixed styling of the incentivized testnet rewards wallet dropdown ([PR 2907](https://github.com/input-output-hk/daedalus/pull/2907))
1314
- Fix warning sign displayed when recommend decimals is zero ([PR 2905](https://github.com/input-output-hk/daedalus/pull/2905))
1415
- Fixed discrete tooltip being clipped by loading overlay when stake pools are adjusted ([PR 2902](https://github.com/input-output-hk/daedalus/pull/2902))

source/renderer/app/components/settings/categories/WalletsSettings.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,10 @@
7272
height: 1px;
7373
margin: 15px 0;
7474
}
75+
76+
:global {
77+
.SimpleOptions_search:before {
78+
opacity: 1;
79+
}
80+
}
7581
}

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,25 @@
1818
bottom: 12.5px;
1919
color: var(--theme-staking-stake-pools-search-icon-color);
2020
left: 20px;
21-
opacity: 0.3;
2221
position: absolute;
2322
z-index: 1;
2423

2524
svg {
2625
opacity: 0.3;
2726
width: 15px;
27+
2828
g > g {
2929
fill: var(--theme-staking-stake-pools-search-icon-color);
3030
}
3131
}
3232
}
3333

34+
.searchIconFocus {
35+
svg {
36+
opacity: 0.7;
37+
}
38+
}
39+
3440
.searchInput {
3541
input {
3642
border-radius: 4px;

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

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useRef } from 'react';
1+
import React, { useRef, useState } from 'react';
22
import SVGInline from 'react-svg-inline';
33
import { injectIntl } from 'react-intl';
44
import { Input } from 'react-polymorph/lib/components/Input';
@@ -57,15 +57,20 @@ function StakePoolsSearchComponent({
5757
null
5858
);
5959

60-
const autoSelectOnFocus = () =>
60+
const [isSearchInputFocused, setSearchInputFocused] = useState(false);
61+
62+
const autoSelectOnFocus = () => {
6163
searchInput?.current
62-
? searchInput?.current?.inputElement.current.select()
64+
? searchInput.current.inputElement?.current?.select()
6365
: false;
6466

67+
setSearchInputFocused(true);
68+
};
69+
6570
const handleClearSearch = () => {
6671
onClearSearch();
67-
6872
searchInput?.current?.inputElement.current.focus();
73+
setSearchInputFocused(true);
6974
};
7075

7176
const hasSearchClearButton = () => {
@@ -96,7 +101,13 @@ function StakePoolsSearchComponent({
96101
{({ scrollElementRef }) => (
97102
<div className={styles.component}>
98103
<div className={styles.container}>
99-
<SVGInline svg={searchIcon} className={styles.searchIcon} />
104+
<SVGInline
105+
svg={searchIcon}
106+
className={classnames(
107+
styles.searchIcon,
108+
isSearchInputFocused && styles.searchIconFocus
109+
)}
110+
/>
100111
<Input
101112
autoFocus
102113
label={label || null}
@@ -105,14 +116,15 @@ function StakePoolsSearchComponent({
105116
ref={(input) => {
106117
searchInput.current = input;
107118
}}
119+
onFocus={autoSelectOnFocus}
120+
onBlur={() => setSearchInputFocused(false)}
108121
placeholder={
109122
placeholder ||
110123
intl.formatMessage(messages.searchInputPlaceholder)
111124
}
112125
skin={InputSkin}
113126
value={search}
114127
maxLength={150}
115-
onFocus={autoSelectOnFocus}
116128
/>
117129
{hasSearchClearButton && (
118130
<div className={clearSearchClasses}>

source/renderer/app/components/wallet/tokens/wallet-tokens-search/WalletTokensSearch.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
position: relative;
33

44
.searchIcon {
5-
color: var(--rp-input-border-color);
5+
color: var(--theme-staking-stake-pools-search-icon-color);
66
left: 20px;
77
position: absolute;
88
top: 19px;
@@ -15,8 +15,10 @@
1515
}
1616
}
1717

18-
.focusSearchIcon {
19-
color: var(--rp-input-border-color-focus);
18+
.searchIconFocus {
19+
svg {
20+
opacity: 0.7;
21+
}
2022
}
2123

2224
input {

source/renderer/app/components/wallet/tokens/wallet-tokens-search/WalletTokensSearch.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,20 @@ type Props = {
2525

2626
const WalletTokensSearch = (props: Props) => {
2727
const { searchValue, onSearch, intl } = props;
28-
const [focus, setFocus] = useState(false);
28+
const [isSearchInputFocused, setSearchInputFocused] = useState(false);
29+
2930
return (
3031
<div className={styles.component}>
3132
<SVGInline
3233
svg={searchIcon}
3334
className={classNames(
3435
styles.searchIcon,
35-
focus && styles.focusSearchIcon
36+
isSearchInputFocused && styles.searchIconFocus
3637
)}
3738
/>
3839
<Input
39-
onFocus={() => setFocus(true)}
40-
onBlur={() => setFocus(false)}
40+
onFocus={() => setSearchInputFocused(true)}
41+
onBlur={() => setSearchInputFocused(false)}
4142
onChange={onSearch}
4243
value={searchValue}
4344
placeholder={intl.formatMessage(messages.placeholder)}

source/renderer/app/themes/daedalus/cardano.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ export const CARDANO_THEME_OUTPUT = {
873873
'--theme-staking-stake-pool-tooltip-table-title-color': '#5e6066',
874874
'--theme-staking-stake-pool-tooltip-text-color': '#5e6066',
875875
'--theme-staking-stake-pools-search-button-color': '#5e6066',
876-
'--theme-staking-stake-pools-search-icon-color': 'rgba(94, 96, 102, 1)',
876+
'--theme-staking-stake-pools-search-icon-color': '#5e6066',
877877
'--theme-staking-stake-pools-search-clear-button-background-color':
878878
'rgba(32, 34, 37, 0.1)',
879879
'--theme-staking-stake-pools-search-clear-button-color': '#5e6066',

source/renderer/app/themes/daedalus/dark-blue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ export const DARK_BLUE_THEME_OUTPUT = {
876876
'--theme-staking-stake-pool-tooltip-table-title-color': '#e9f4fe',
877877
'--theme-staking-stake-pool-tooltip-text-color': '#e9f4fe',
878878
'--theme-staking-stake-pools-search-button-color': '#e9f4fe',
879-
'--theme-staking-stake-pools-search-icon-color': '#8793a1',
879+
'--theme-staking-stake-pools-search-icon-color': '#e9f4fe',
880880
'--theme-staking-stake-pools-search-clear-button-background-color':
881881
'rgba(233, 244, 254, 0.1)',
882882
'--theme-staking-stake-pools-search-clear-button-color':

source/renderer/app/themes/daedalus/light-blue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ export const LIGHT_BLUE_THEME_OUTPUT = {
869869
'--theme-staking-stake-pool-tooltip-table-title-color': '#5e6066',
870870
'--theme-staking-stake-pool-tooltip-text-color': '#5e6066',
871871
'--theme-staking-stake-pools-search-button-color': '#5e6066',
872-
'--theme-staking-stake-pools-search-icon-color': 'rgba(94, 96, 102, 1)',
872+
'--theme-staking-stake-pools-search-icon-color': '#5e6066',
873873
'--theme-staking-stake-pools-search-clear-button-background-color':
874874
'rgba(68, 91, 124, 0.1)',
875875
'--theme-staking-stake-pools-search-clear-button-color': '#5e6066',

0 commit comments

Comments
 (0)