Skip to content

Commit 73580de

Browse files
committed
improvement(swap): show add a send only for expert mode
1 parent e32fd3a commit 73580de

File tree

3 files changed

+32
-42
lines changed

3 files changed

+32
-42
lines changed

src/components/CurrencyInputPanel/index.tsx

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import CurrencySearchModal from '../SearchModal/CurrencySearchModal'
77
import CurrencyLogo from '../CurrencyLogo'
88
import DoubleCurrencyLogo from '../DoubleLogo'
99
import { RowBetween } from '../Row'
10-
import { TYPE, CursorPointer } from '../../theme'
10+
import { TYPE } from '../../theme'
1111
import { Input as NumericalInput } from '../NumericalInput'
1212
import { ReactComponent as DropDown } from '../../assets/images/dropdown.svg'
1313

@@ -170,19 +170,17 @@ export default function CurrencyInputPanel({
170170
{label}
171171
</TYPE.body>
172172
{account && (
173-
<CursorPointer>
174-
<TYPE.body
175-
onClick={onMax}
176-
color={theme.text2}
177-
fontWeight={500}
178-
fontSize={14}
179-
style={{ display: 'inline' }}
180-
>
181-
{!hideBalance && !!currency && selectedCurrencyBalance
182-
? 'Balance: ' + selectedCurrencyBalance?.toSignificant(6)
183-
: ' -'}
184-
</TYPE.body>
185-
</CursorPointer>
173+
<TYPE.body
174+
onClick={onMax}
175+
color={theme.text2}
176+
fontWeight={500}
177+
fontSize={14}
178+
style={{ display: 'inline', cursor: 'pointer' }}
179+
>
180+
{!hideBalance && !!currency && selectedCurrencyBalance
181+
? 'Balance: ' + selectedCurrencyBalance?.toSignificant(6)
182+
: ' -'}
183+
</TYPE.body>
186184
)}
187185
</RowBetween>
188186
</LabelRow>

src/pages/Swap/index.tsx

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import {
4141
useUserDeadline,
4242
useUserSlippageTolerance
4343
} from '../../state/user/hooks'
44-
import { CursorPointer, LinkStyledButton, TYPE } from '../../theme'
44+
import { LinkStyledButton, TYPE } from '../../theme'
4545
import { maxAmountSpend } from '../../utils/maxAmountSpend'
4646
import { computeTradePriceBreakdown, warningSeverity } from '../../utils/prices'
4747
import AppBody from '../AppBody'
@@ -285,27 +285,25 @@ export default function Swap() {
285285
id="swap-currency-input"
286286
/>
287287

288-
<CursorPointer>
289-
<AutoColumn justify="space-between">
290-
<AutoRow justify="space-between" style={{ padding: '0 1rem' }}>
291-
<ArrowWrapper clickable>
292-
<ArrowDown
293-
size="16"
294-
onClick={() => {
295-
setApprovalSubmitted(false) // reset 2 step UI for approvals
296-
onSwitchTokens()
297-
}}
298-
color={currencies[Field.INPUT] && currencies[Field.OUTPUT] ? theme.primary1 : theme.text2}
299-
/>
300-
</ArrowWrapper>
301-
{recipient === null && !showWrap ? (
302-
<LinkStyledButton id="add-recipient-button" onClick={() => onChangeRecipient('')}>
303-
+ Add a send (optional)
304-
</LinkStyledButton>
305-
) : null}
306-
</AutoRow>
307-
</AutoColumn>
308-
</CursorPointer>
288+
<AutoColumn justify="space-between">
289+
<AutoRow justify="space-between" style={{ padding: '0 1rem' }}>
290+
<ArrowWrapper clickable>
291+
<ArrowDown
292+
size="16"
293+
onClick={() => {
294+
setApprovalSubmitted(false) // reset 2 step UI for approvals
295+
onSwitchTokens()
296+
}}
297+
color={currencies[Field.INPUT] && currencies[Field.OUTPUT] ? theme.primary1 : theme.text2}
298+
/>
299+
</ArrowWrapper>
300+
{recipient === null && !showWrap && isExpertMode ? (
301+
<LinkStyledButton id="add-recipient-button" onClick={() => onChangeRecipient('')}>
302+
+ Add a send (optional)
303+
</LinkStyledButton>
304+
) : null}
305+
</AutoRow>
306+
</AutoColumn>
309307
<CurrencyInputPanel
310308
value={formattedAmounts[Field.OUTPUT]}
311309
onUserInput={handleTypeOutput}

src/theme/components.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,6 @@ export const Spinner = styled.img`
148148
height: 16px;
149149
`
150150

151-
export const CursorPointer = styled.div`
152-
:hover {
153-
cursor: pointer;
154-
}
155-
`
156-
157151
const BackArrowLink = styled(StyledInternalLink)`
158152
color: ${({ theme }) => theme.text1};
159153
`

0 commit comments

Comments
 (0)