Skip to content

Commit d42ed88

Browse files
authored
fix: fix various selected states on Explore filters and update theme colors (Uniswap#4433)
* fixed * update more
1 parent e12c00e commit d42ed88

File tree

4 files changed

+31
-25
lines changed

4 files changed

+31
-25
lines changed

src/components/Tokens/TokenTable/FavoriteButton.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const StyledFavoriteButton = styled.button<{ active: boolean }>`
1616
border-radius: 12px;
1717
background-color: ${({ theme, active }) => (active ? theme.accentAction : theme.backgroundInteractive)};
1818
border: none;
19-
color: ${({ theme }) => theme.textPrimary};
19+
color: ${({ theme, active }) => (active ? theme.white : theme.textPrimary)};
2020
font-size: 16px;
2121
font-weight: 600;
2222
cursor: pointer;
@@ -37,7 +37,7 @@ export default function FavoriteButton() {
3737
return (
3838
<StyledFavoriteButton onClick={() => setShowFavorites(!showFavorites)} active={showFavorites}>
3939
<FavoriteButtonContent>
40-
<Heart size={17} color={theme.textPrimary} fill="transparent" />
40+
<Heart size={17} color={showFavorites ? theme.white : theme.textPrimary} fill="transparent" />
4141
<FavoriteText>Favorites</FavoriteText>
4242
</FavoriteButtonContent>
4343
</StyledFavoriteButton>

src/components/Tokens/TokenTable/NetworkFilter.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const StyledMenuButton = styled.button<{ open: boolean }>`
6565
height: 100%;
6666
color: ${({ theme, open }) => (open ? theme.blue200 : theme.textPrimary)};
6767
border: none;
68-
background-color: ${({ theme, open }) => (open ? theme.accentActionSoft : theme.backgroundInteractive)};
68+
background-color: ${({ theme, open }) => (open ? theme.accentActiveSoft : theme.backgroundInteractive)};
6969
margin: 0;
7070
padding: 6px 12px 6px 12px;
7171
border-radius: 12px;
@@ -76,10 +76,13 @@ const StyledMenuButton = styled.button<{ open: boolean }>`
7676
:hover {
7777
cursor: pointer;
7878
outline: none;
79-
background-color: ${({ theme, open }) => (open ? theme.accentActionSoft : theme.backgroundModule)};
79+
border: none;
80+
background-color: ${({ theme, open }) => (open ? theme.accentActiveSoft : theme.backgroundModule)};
8081
}
8182
:focus {
82-
background-color: ${({ theme, open }) => (open ? theme.accentActionSoft : theme.backgroundInteractive)};
83+
background-color: ${({ theme, open }) => (open ? theme.accentActiveSoft : theme.backgroundInteractive)};
84+
border: none;
85+
outline: none;
8386
}
8487
svg {
8588
margin-top: 2px;

src/components/Tokens/TokenTable/TimeSelector.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const StyledMenuButton = styled.button<{ open: boolean }>`
8383
border: none;
8484
color: ${({ theme, open }) => (open ? theme.blue200 : theme.textPrimary)};
8585
margin: 0;
86-
background-color: ${({ theme, open }) => (open ? theme.accentActionSoft : theme.backgroundInteractive)};
86+
background-color: ${({ theme, open }) => (open ? theme.accentActiveSoft : theme.backgroundInteractive)};
8787
padding: 6px 12px 6px 12px;
8888
border-radius: 12px;
8989
font-size: 16px;
@@ -92,11 +92,14 @@ const StyledMenuButton = styled.button<{ open: boolean }>`
9292
9393
:hover {
9494
cursor: pointer;
95+
border: none;
9596
outline: none;
96-
background-color: ${({ theme, open }) => (open ? theme.accentActionSoft : theme.backgroundModule)};
97+
background-color: ${({ theme, open }) => (open ? theme.accentActiveSoft : theme.backgroundModule)};
9798
}
9899
:focus {
99-
background-color: ${({ theme, open }) => (open ? theme.accentActionSoft : theme.backgroundInteractive)};
100+
background-color: ${({ theme, open }) => (open ? theme.accentActiveSoft : theme.backgroundInteractive)};
101+
border: none;
102+
outline: none;
100103
}
101104
svg {
102105
margin-top: 2px;

src/theme/colors.ts

+17-17
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ export const colorsLight: Palette = {
232232
backgroundBackdrop: colors.white,
233233
backgroundSurface: colors.white,
234234
backgroundModule: colors.gray50,
235-
backgroundInteractive: opacify(6, colors.gray700),
236-
backgroundFloating: opacify(8, colors.white),
235+
backgroundInteractive: colors.gray100,
236+
backgroundFloating: opacify(8, colors.gray700),
237237
backgroundOutline: opacify(24, colors.gray500),
238238
backgroundScrim: opacify(60, colors.gray900),
239239

@@ -248,18 +248,18 @@ export const colorsLight: Palette = {
248248
accentFailure: colors.red400,
249249
accentCritical: colors.red400,
250250

251-
accentActionSoft: opacify(12, colors.pink400),
252-
accentActiveSoft: opacify(12, colors.blue400),
253-
accentSuccessSoft: opacify(12, colors.green400),
254-
accentWarningSoft: opacify(12, colors.gold200),
255-
accentFailureSoft: opacify(12, colors.red400),
251+
accentActionSoft: opacify(24, colors.pink400),
252+
accentActiveSoft: opacify(24, colors.blue400),
253+
accentSuccessSoft: opacify(24, colors.green400),
254+
accentWarningSoft: opacify(24, colors.gold200),
255+
accentFailureSoft: opacify(24, colors.red400),
256256

257-
accentTextDarkPrimary: opacify(80, colors.black),
258-
accentTextDarkSecondary: opacify(60, colors.black),
259-
accentTextDarkTertiary: opacify(24, colors.black),
257+
accentTextDarkPrimary: opacify(80, colors.gray900),
258+
accentTextDarkSecondary: opacify(60, colors.gray900),
259+
accentTextDarkTertiary: opacify(24, colors.gray900),
260260

261261
accentTextLightPrimary: colors.white,
262-
accentTextLightSecondary: opacify(60, colors.white),
262+
accentTextLightSecondary: opacify(72, colors.white),
263263
accentTextLightTertiary: opacify(12, colors.white),
264264

265265
white: colors.white,
@@ -293,25 +293,25 @@ export const colorsDark: Palette = {
293293
backgroundSurface: colors.gray900,
294294
backgroundModule: opacify(8, colors.gray300),
295295
backgroundInteractive: colors.gray700,
296-
backgroundFloating: opacify(8, colors.gray700),
296+
backgroundFloating: opacify(12, colors.black),
297297
backgroundOutline: opacify(24, colors.gray300),
298298
backgroundScrim: opacify(72, colors.gray900),
299299

300300
textPrimary: colors.white,
301301
textSecondary: colors.gray300,
302-
textTertiary: colors.gray400,
302+
textTertiary: colors.gray500,
303303

304304
accentAction: colors.blue400,
305305
accentActive: colors.blue400,
306-
accentSuccess: colors.greenVibrant,
306+
accentSuccess: colors.green200,
307307
accentWarning: colors.gold200,
308308
accentFailure: colors.red400,
309309
accentCritical: colors.red300,
310310

311311
accentActionSoft: opacify(24, colors.blue400),
312-
accentActiveSoft: opacify(12, colors.blue400),
313-
accentSuccessSoft: opacify(12, colors.green400),
314-
accentWarningSoft: opacify(12, colors.gold200),
312+
accentActiveSoft: opacify(24, colors.blue400),
313+
accentSuccessSoft: opacify(24, colors.green400),
314+
accentWarningSoft: opacify(24, colors.gold200),
315315
accentFailureSoft: opacify(12, colors.red400),
316316

317317
accentTextDarkPrimary: opacify(80, colors.black),

0 commit comments

Comments
 (0)