Skip to content

Commit da22c6d

Browse files
callilNoahZinsmeister
authored andcommitted
Style token modal and toggle switch (Uniswap#413)
1 parent 1c6fa17 commit da22c6d

File tree

10 files changed

+44
-33
lines changed

10 files changed

+44
-33
lines changed

src/components/AddressInputPanel/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { useDebounce } from '../../hooks'
99

1010
const InputPanel = styled.div`
1111
${({ theme }) => theme.flexColumnNoWrap}
12-
box-shadow: 0 4px 8px 0 ${({ theme }) => transparentize(0.95, theme.royalBlue)};
12+
box-shadow: 0 4px 8px 0 ${({ theme }) => transparentize(0.95, theme.shadowColor)};
1313
position: relative;
1414
border-radius: 1.25rem;
1515
background-color: ${({ theme }) => theme.inputBackground};
@@ -24,7 +24,6 @@ const ContainerRow = styled.div`
2424
border: 1px solid ${({ error, theme }) => (error ? theme.salmonRed : theme.mercuryGray)};
2525
2626
background-color: ${({ theme }) => theme.inputBackground};
27-
transition: box-shadow 125ms ease-in-out;
2827
`
2928

3029
const InputContainer = styled.div`
@@ -63,7 +62,6 @@ const Input = styled.input`
6362
background-color: ${({ theme }) => theme.inputBackground};
6463
6564
color: ${({ error, theme }) => (error ? theme.salmonRed : theme.royalBlue)};
66-
transition: color 125ms ease-in-out;
6765
overflow: hidden;
6866
text-overflow: ellipsis;
6967

src/components/CurrencyInputPanel/index.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import TokenLogo from '../TokenLogo'
1919
import SearchIcon from '../../assets/images/magnifying-glass.svg'
2020
import { useTransactionAdder, usePendingApproval } from '../../contexts/Transactions'
2121
import { useTokenDetails, useAllTokenDetails } from '../../contexts/Tokens'
22-
import close from '../../assets/images/x.svg'
22+
import { ReactComponent as Close } from '../../assets/images/x.svg'
2323
import { transparentize } from 'polished'
2424
import { Spinner } from '../../theme'
2525
import Circle from '../../assets/images/circle-grey.svg'
@@ -30,6 +30,7 @@ const GAS_MARGIN = ethers.utils.bigNumberify(1000)
3030
const SubCurrencySelect = styled.button`
3131
${({ theme }) => theme.flexRowNoWrap}
3232
background: ${({ theme }) => theme.zumthorBlue};
33+
3334
border: 1px solid ${({ theme }) => theme.royalBlue};
3435
color: ${({ theme }) => theme.royalBlue};
3536
line-height: 0;
@@ -106,7 +107,7 @@ const StyledDropDown = styled(DropDown)`
106107

107108
const InputPanel = styled.div`
108109
${({ theme }) => theme.flexColumnNoWrap}
109-
box-shadow: 0 4px 8px 0 ${({ theme }) => transparentize(0.95, theme.royalBlue)};
110+
box-shadow: 0 4px 8px 0 ${({ theme }) => transparentize(0.95, theme.shadowColor)};
110111
position: relative;
111112
border-radius: 1.25rem;
112113
background-color: ${({ theme }) => theme.inputBackground};
@@ -118,8 +119,6 @@ const Container = styled.div`
118119
border: 1px solid ${({ error, theme }) => (error ? theme.salmonRed : theme.mercuryGray)};
119120
120121
background-color: ${({ theme }) => theme.inputBackground};
121-
transition: box-shadow 150ms ease-out;
122-
123122
:focus-within {
124123
border: 1px solid ${({ theme }) => theme.malibuBlue};
125124
}
@@ -164,21 +163,30 @@ const ModalHeader = styled.div`
164163
display: flex;
165164
flex-direction: row;
166165
align-items: center;
167-
padding: 0 2rem;
166+
padding: 0px 0px 0px 1rem;
168167
height: 60px;
169168
`
170169

170+
const CloseColor = styled(Close)`
171+
path {
172+
stroke: ${({ theme }) => theme.textColor};
173+
}
174+
`
175+
171176
const CloseIcon = styled.div`
172177
position: absolute;
173-
right: 1.4rem;
178+
right: 1rem;
179+
top: 14px;
174180
&:hover {
175181
cursor: pointer;
182+
opacity: 0.6;
176183
}
177184
`
178185

179186
const SearchContainer = styled.div`
180187
${({ theme }) => theme.flexRowNoWrap}
181-
padding: 0.5rem 2rem;
188+
justify-content: flex-start;
189+
padding: 0.5rem 1.5rem;
182190
background-color: ${({ theme }) => theme.concreteGray};
183191
`
184192

@@ -202,7 +210,7 @@ const TokenModalRow = styled.div`
202210
${({ theme }) => theme.flexRowNoWrap}
203211
align-items: center;
204212
justify-content: space-between;
205-
padding: 0.8rem 2rem;
213+
padding: 1rem;
206214
cursor: pointer;
207215
user-select: none;
208216
@@ -580,7 +588,7 @@ function CurrencySelectModal({ isOpen, onDismiss, onTokenSelect, allBalances })
580588
<ModalHeader>
581589
<p>Select Token</p>
582590
<CloseIcon onClick={clearInputAndDismiss}>
583-
<img src={close} alt={'close icon'} />
591+
<CloseColor alt={'close icon'} />
584592
</CloseIcon>
585593
</ModalHeader>
586594
<SearchContainer>

src/components/Footer/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,16 @@ const StyledToggle = styled(Toggle)`
4949
margin-right: 24px;
5050
5151
.react-switch-bg[style] {
52-
background-color: ${({ theme }) => theme.inputBackground} !important;
52+
background-color: ${({ theme }) => darken(0.05, theme.inputBackground)} !important;
5353
border: 1px solid ${({ theme }) => theme.concreteGray} !important;
5454
}
5555
5656
.react-switch-handle[style] {
5757
background-color: ${({ theme }) => theme.inputBackground};
58-
box-shadow: 0 4px 8px 0 ${({ theme }) => transparentize(0.93, theme.royalBlue)};
58+
box-shadow: 0 4px 8px 0 ${({ theme }) => transparentize(0.93, theme.shadowColor)};
5959
border: 1px solid ${({ theme }) => theme.mercuryGray};
6060
border-color: ${({ theme }) => theme.mercuryGray} !important;
61+
top: 2px !important;
6162
}
6263
`
6364

src/components/Header/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const Title = styled.div`
4747
font-weight: 500;
4848
color: ${({ theme }) => theme.wisteriaPurple};
4949
:hover {
50-
color: ${({ theme }) => darken(0.2, theme.wisteriaPurple)};
50+
color: ${({ theme }) => darken(0.1, theme.wisteriaPurple)};
5151
}
5252
}
5353
`

src/components/Modal/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import styled, { css } from 'styled-components'
33
import { animated, useTransition } from 'react-spring'
44
import { DialogOverlay, DialogContent } from '@reach/dialog'
55
import '@reach/dialog/styles.css'
6+
import { transparentize } from 'polished'
67

78
const AnimatedDialogOverlay = animated(DialogOverlay)
89
const WrappedDialogOverlay = ({ suppressClassNameWarning, ...rest }) => <AnimatedDialogOverlay {...rest} />
@@ -14,6 +15,7 @@ const StyledDialogOverlay = styled(WrappedDialogOverlay).attrs({
1415
display: flex;
1516
align-items: center;
1617
justify-content: center;
18+
background-color: ${({ theme }) => theme.modalBackground};
1719
}
1820
`
1921

@@ -23,6 +25,7 @@ const StyledDialogContent = styled(FilteredDialogContent)`
2325
margin: 0 0 2rem 0;
2426
border: 1px solid ${({ theme }) => theme.concreteGray};
2527
background-color: ${({ theme }) => theme.inputBackground};
28+
box-shadow: 0 4px 8px 0 ${({ theme }) => transparentize(0.95, theme.shadowColor)};
2629
${({ theme }) => theme.mediaWidth.upToMedium`margin: 0;`};
2730
padding: 0px;
2831
width: 50vw;

src/components/NavigationTabs/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ const StyledNavLink = styled(NavLink).attrs({
8787
background-color: ${({ theme }) => theme.inputBackground};
8888
border-radius: 3rem;
8989
border: 1px solid ${({ theme }) => theme.mercuryGray};
90-
box-shadow: 0 4px 8px 0 ${({ theme }) => transparentize(0.95, theme.royalBlue)};
90+
box-shadow: 0 4px 8px 0 ${({ theme }) => transparentize(0.95, theme.shadowColor)};
9191
box-sizing: border-box;
9292
font-weight: 500;
9393
color: ${({ theme }) => theme.royalBlue};
9494
:hover {
95-
border: 1px solid ${({ theme }) => darken(0.1, theme.mercuryGray)};
95+
/* border: 1px solid ${({ theme }) => darken(0.1, theme.mercuryGray)}; */
9696
background-color: ${({ theme }) => darken(0.01, theme.inputBackground)};
9797
}
9898
}

src/components/Web3Status/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ const Web3StatusConnected = styled(Web3StatusGeneric)`
6060
font-weight: 400;
6161
:hover {
6262
63-
> P {
63+
/* > P {
6464
color: ${({ theme }) => theme.uniswapPink};
65-
}
65+
} */
6666
background-color: ${({ pending, theme }) =>
67-
pending ? transparentize(0.9, theme.royalBlue) : transparentize(0.9, theme.mercuryGray)};
67+
pending ? transparentize(0.9, theme.royalBlue) : darken(0.05, theme.inputBackground)};
6868
6969
:focus {
7070
border: 1px solid

src/theme/components.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export const Button = styled.button.attrs(({ warning, theme }) => ({
1212
border: none;
1313
outline: none;
1414
background-color: ${({ backgroundColor }) => backgroundColor};
15-
transition: background-color 150ms ease-out;
1615
color: ${({ theme }) => theme.white};
1716
width: 100%;
1817

src/theme/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ const theme = darkMode => ({
4040
// for setting css on <html>
4141
backgroundColor: darkMode ? '#333639' : white,
4242

43+
modalBackground: darkMode ? 'rgba(0,0,0,0.6)' : 'rgba(0,0,0,0.3)',
4344
inputBackground: darkMode ? '#202124' : white,
4445
placeholderGray: darkMode ? '#5F5F5F' : '#E1E1E1',
46+
shadowColor: darkMode ? '#000' : '#2F80ED',
4547

4648
// grays
4749
concreteGray: darkMode ? '#292C2F' : '#FAFAFA',
@@ -59,6 +61,7 @@ const theme = darkMode => ({
5961
malibuBlue: darkMode ? '#E67AEF' : '#5CA2FF',
6062
royalBlue: darkMode ? '#DC6BE5' : '#2F80ED',
6163
loadingBlue: darkMode ? '#e4f0ff' : '#e4f0ff',
64+
6265
// purples
6366
wisteriaPurple: '#DC6BE5',
6467
// reds
@@ -114,7 +117,6 @@ export const GlobalStyle = createGlobalStyle`
114117
font-variant: none;
115118
color: ${({ theme }) => theme.textColor};
116119
background-color: ${({ theme }) => theme.backgroundColor};
117-
transition: color 150ms ease-out, background-color 150ms ease-out;
118120
-webkit-font-smoothing: antialiased;
119121
-moz-osx-font-smoothing: grayscale;
120122
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);

yarn.lock

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4831,9 +4831,9 @@ ee-first@1.1.1:
48314831
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
48324832

48334833
electron-to-chromium@^1.3.191, electron-to-chromium@^1.3.47:
4834-
version "1.3.224"
4835-
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.224.tgz#511abb2829a58c5ddb36c319094fe936bc82e3cd"
4836-
integrity sha512-vTH9UcMbi53x/pZKQrEcD83obE8agqQwUIx/G03/mpE1vzLm0KA3cHwuZXCysvxI1gXfNjV7Nu7Vjtp89kDzmg==
4834+
version "1.3.225"
4835+
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.225.tgz#c6786475b5eb5f491ade01a78b82ba2c5bfdf72b"
4836+
integrity sha512-7W/L3jw7HYE+tUPbcVOGBmnSrlUmyZ/Uyg24QS7Vx0a9KodtNrN0r0Q/LyGHrcYMtw2rv7E49F/vTXwlV/fuaA==
48374837

48384838
elliptic@6.3.3:
48394839
version "6.3.3"
@@ -5032,9 +5032,9 @@ escape-string-regexp@^2.0.0:
50325032
integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==
50335033

50345034
escodegen@^1.11.0, escodegen@^1.9.1:
5035-
version "1.11.1"
5036-
resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.1.tgz#c485ff8d6b4cdb89e27f4a856e91f118401ca510"
5037-
integrity sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw==
5035+
version "1.12.0"
5036+
resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.12.0.tgz#f763daf840af172bb3a2b6dd7219c0e17f7ff541"
5037+
integrity sha512-TuA+EhsanGcme5T3R0L80u4t8CpbXQjegRmf7+FPTJrtCTErXFeelblRgHQa1FofEzqYYJmJ/OqjTwREp9qgmg==
50385038
dependencies:
50395039
esprima "^3.1.3"
50405040
estraverse "^4.2.0"
@@ -5168,9 +5168,9 @@ eslint-utils@^1.3.1:
51685168
eslint-visitor-keys "^1.0.0"
51695169

51705170
eslint-visitor-keys@^1.0.0:
5171-
version "1.0.0"
5172-
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d"
5173-
integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==
5171+
version "1.1.0"
5172+
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2"
5173+
integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==
51745174

51755175
eslint@^6.1.0:
51765176
version "6.1.0"
@@ -5434,8 +5434,8 @@ ethereumjs-abi@0.6.7:
54345434
ethereumjs-util "^6.0.0"
54355435

54365436
"ethereumjs-abi@git+https://github.com/ethereumjs/ethereumjs-abi.git":
5437-
version "0.6.7"
5438-
resolved "git+https://github.com/ethereumjs/ethereumjs-abi.git#d700d091f79c06f4e27872f4a1d7b153986cc3dd"
5437+
version "0.6.8"
5438+
resolved "git+https://github.com/ethereumjs/ethereumjs-abi.git#1cfbb13862f90f0b391d8a699544d5fe4dfb8c7b"
54395439
dependencies:
54405440
bn.js "^4.11.8"
54415441
ethereumjs-util "^6.0.0"

0 commit comments

Comments
 (0)