Skip to content

Commit

Permalink
Slim down FR protection footer
Browse files Browse the repository at this point in the history
  • Loading branch information
Dire-0x committed Sep 7, 2021
1 parent e33abdf commit e33a75d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 22 deletions.
Binary file removed src/assets/images/flashbots.png
Binary file not shown.
5 changes: 4 additions & 1 deletion src/components/TransactionSettings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,10 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction
</TYPE.black>
<QuestionHelper
text={
<Trans>Your transaction will be relayed to the network via a private transaction mining service.</Trans>
<>
<Trans>Your transaction will be protected from frontrunning attacks. </Trans>
<TYPE.italic marginTop={'4px'}>Powered by Flashbots & mistX</TYPE.italic>
</>
}
/>
</RowFixed>
Expand Down
23 changes: 3 additions & 20 deletions src/components/swap/FrontrunningProtectionFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,37 +1,20 @@
import styled from 'styled-components/macro'
import { TYPE } from '../../theme'
import FlashbotsLogo from '../../assets/images/flashbots.png'
const DetailsFooter = styled.div`
padding: 0 20px 20px 20px;
padding: 6px;
width: 100%;
max-width: 400px;
border-bottom-left-radius: 20px;
border-bottom-right-radius: 20px;
color: ${({ theme }) => theme.text2};
background-color: ${({ theme }) => theme.advancedBG};
display: flex;
`
const StyledLogo = styled.img`
height: 46px;
width: 46px;
margin-right: 8px;
margin-top: 20px;
`

const Description = styled.div`
padding-top: 16px;
text-align: center;
`

export default function FrontrunningProtectionFooter() {
return (
<DetailsFooter>
<StyledLogo src={FlashbotsLogo} />
<Description>
<TYPE.black fontWeight={500}>Frontrunning Protection</TYPE.black>
<TYPE.italic marginTop="4px">
Your transactions are protected from frontrunning attacks using Flashbots & mistX
</TYPE.italic>
</Description>
<TYPE.italic>Frontrunning Protection: On</TYPE.italic>
</DetailsFooter>
)
}
2 changes: 1 addition & 1 deletion src/pages/Swap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ export default function Swap({ history }: RouteComponentProps) {
</Wrapper>
</AppBody>
<SwitchLocaleLink />
{frontrunningProtection ? <FrontrunningProtectionFooter /> : null}
{frontrunningProtection && !swapIsUnsupported ? <FrontrunningProtectionFooter /> : null}
{!swapIsUnsupported ? null : (
<UnsupportedCurrencyFooter
show={swapIsUnsupported}
Expand Down

0 comments on commit e33a75d

Please sign in to comment.