Skip to content

Commit

Permalink
Add slippage option (Uniswap#369)
Browse files Browse the repository at this point in the history
* add custom slippage to /swap
  • Loading branch information
ianlapham authored and NoahZinsmeister committed Jul 26, 2019
1 parent 12344f7 commit 30887ef
Show file tree
Hide file tree
Showing 12 changed files with 647 additions and 145 deletions.
3 changes: 2 additions & 1 deletion public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,6 @@
"symbol": "Symbol",
"decimals": "Decimals",
"enterTokenCont": "Enter a token address to continue",
"priceChange": "This trade will cause the price to change by"
"priceChange": "Expected price slippage",
"forAtLeast" : "for at least "
}
4 changes: 4 additions & 0 deletions src/assets/images/question-mark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/images/question.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/AddressInputPanel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const ContainerRow = styled.div`
justify-content: center;
align-items: center;
border-radius: 1.25rem;
box-shadow: 0 0 0 0.5px ${({ error, theme }) => (error ? theme.salmonRed : theme.mercuryGray)};
box-shadow: 0 0 0 1px ${({ error, theme }) => (error ? theme.salmonRed : theme.mercuryGray)};
background-color: ${({ theme }) => theme.white};
transition: box-shadow 200ms ease-in-out;
`
Expand Down
11 changes: 5 additions & 6 deletions src/components/ContextualInfoNew/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ const SummaryWrapperContainer = styled.div`

const Details = styled.div`
background-color: ${({ theme }) => theme.concreteGray};
padding: 1.5rem;
/* padding: 1.25rem 1.25rem 1rem 1.25rem; */
border-radius: 1rem;
font-size: 0.75rem;
margin-top: 1rem;
margin: 1rem 0.5rem 0 0.5rem;
`

const ErrorSpan = styled.span`
Expand Down Expand Up @@ -89,13 +89,12 @@ export default function ContextualInfo({
closeDetailsText = 'Hide Details',
contextualInfo = '',
allowExpand = false,
renderTransactionDetails = () => {},
isError = false,
slippageWarning,
highSlippageWarning
highSlippageWarning,
dropDownContent
}) {
const [showDetails, setShowDetails] = useState(false)

return !allowExpand ? (
<SummaryWrapper>{contextualInfo}</SummaryWrapper>
) : (
Expand All @@ -117,7 +116,7 @@ export default function ContextualInfo({
)}
</>
</SummaryWrapperContainer>
{showDetails && <Details>{renderTransactionDetails()}</Details>}
{showDetails && <Details>{dropDownContent()}</Details>}
</>
)
}
6 changes: 3 additions & 3 deletions src/components/CurrencyInputPanel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const CurrencySelect = styled.button`
}
:focus {
box-shadow: 0 0 0.5px 0.5px ${({ theme }) => theme.malibuBlue};
box-shadow: 0 0 1px 1px ${({ theme }) => theme.malibuBlue};
}
:active {
Expand Down Expand Up @@ -104,12 +104,12 @@ const InputPanel = styled.div`

const Container = styled.div`
border-radius: 1.25rem;
box-shadow: 0 0 0 0.5px ${({ error, theme }) => (error ? theme.salmonRed : theme.mercuryGray)};
box-shadow: 0 0 0 1px ${({ error, theme }) => (error ? theme.salmonRed : theme.mercuryGray)};
background-color: ${({ theme }) => theme.white};
transition: box-shadow 200ms ease-in-out;
:focus-within {
box-shadow: 0 0 0.5px 0.5px ${({ theme }) => theme.malibuBlue};
box-shadow: 0 0 1px 1px ${({ theme }) => theme.malibuBlue};
}
`

Expand Down
4 changes: 2 additions & 2 deletions src/components/NavigationTabs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ const StyledNavLink = styled(NavLink).attrs({
&.${activeClassName} {
background-color: ${({ theme }) => theme.white};
border-radius: 3rem;
box-shadow: 0 0 0.5px 1px ${({ theme }) => theme.mercuryGray};
box-shadow: 0 0 1px 1px ${({ theme }) => theme.mercuryGray};
font-weight: 500;
color: ${({ theme }) => theme.royalBlue};
:hover {
box-shadow: 0 0 0.5px 1px ${({ theme }) => darken(0.1, theme.mercuryGray)};
box-shadow: 0 0 1px 1px ${({ theme }) => darken(0.1, theme.mercuryGray)};
}
}
Expand Down
Loading

0 comments on commit 30887ef

Please sign in to comment.