-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
173 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Network } from '@aave/protocol-js'; | ||
import avalancheLogo from './branding/images/avalancheLogo.svg'; | ||
import polygonLogo from './branding/images/polygonLogo.svg'; | ||
|
||
export interface NetworkBannerConfig { | ||
networkName: string; | ||
bridgeName: string; | ||
bridgeUrl: string; | ||
brandColor: string; | ||
bridgeLogo: string; | ||
} | ||
|
||
// Pages where the banners should be displayed | ||
export const DISPLAY_BANNER_PAGES = ['/deposit', '/borrow']; | ||
|
||
export const networkBannerConfigs: { [key: string]: NetworkBannerConfig } = { | ||
[Network.avalanche]: { | ||
brandColor: '#E84142', | ||
networkName: 'Avalanche', | ||
bridgeName: 'Avalanche Bridge', | ||
bridgeUrl: 'https://bridge.avax.network/', | ||
bridgeLogo: avalancheLogo, | ||
}, | ||
[Network.polygon]: { | ||
brandColor: '#8247E5', | ||
networkName: 'Polygon', | ||
bridgeName: 'Polygon PoS Bridge', | ||
bridgeUrl: 'https://wallet.matic.network/bridge/', | ||
bridgeLogo: polygonLogo, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from 'react'; | ||
import { useIntl } from 'react-intl'; | ||
import whiteLinkIcon from '../../../images/whiteLinkIcon.svg'; | ||
import { NetworkBannerConfig } from '../../banners'; | ||
import messages from './messages'; | ||
import staticStyles from './style'; | ||
|
||
export default function NetworkBanner({ | ||
brandColor, | ||
bridgeName, | ||
bridgeUrl, | ||
bridgeLogo, | ||
networkName, | ||
}: NetworkBannerConfig) { | ||
const intl = useIntl(); | ||
|
||
return ( | ||
<div className="NetworkBanner" style={{ backgroundColor: brandColor }}> | ||
<div className="NetoworkBanner__logo"> | ||
<img src={bridgeLogo} /> | ||
</div> | ||
<div className="NetworkBanner__title"> | ||
{intl.formatMessage(messages.title, { | ||
networkName, | ||
})} | ||
| ||
{intl.formatMessage(messages.visit)} | ||
| ||
<strong>{bridgeName}</strong> | ||
</div> | ||
<div className="NetworkBanner__link"> | ||
<a href={bridgeUrl} target="_blank"> | ||
<img src={whiteLinkIcon} /> | ||
</a> | ||
</div> | ||
<style jsx={true}>{staticStyles}</style> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { defineMessages } from 'react-intl'; | ||
|
||
export default defineMessages({ | ||
title: 'Need your Ethereum main network assets on {networkName}?', | ||
visit: 'Please visit', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import css from 'styled-jsx/css'; | ||
|
||
/*language=SCSS*/ | ||
const staticStyles = css.global` | ||
@import 'src/_mixins/vars'; | ||
@import 'src/_mixins/screen-size'; | ||
.NetworkBanner { | ||
width: 100%; | ||
display: flex; | ||
border-radius: 50px; | ||
padding: 8px 24px; | ||
color: white; | ||
justify-content: space-between; | ||
box-shadow: $boxShadow; | ||
position: relative; | ||
&__logo { | ||
display: flex; | ||
align-items: center; | ||
} | ||
&__title { | ||
position: absolute; | ||
left: 0; | ||
right: 0; | ||
text-align: center; | ||
align-items: center; | ||
@include respond-to(md) { | ||
position: relative; | ||
max-width: 343px; | ||
} | ||
} | ||
&__link { | ||
display: flex; | ||
align-items: center; | ||
@include respond-to(md) { | ||
right: 8px; | ||
top: 8px; | ||
position: absolute; | ||
} | ||
} | ||
@include respond-to(md) { | ||
flex-direction: column; | ||
align-items: center; | ||
border-radius: 0px; | ||
div { | ||
padding: 4px; | ||
} | ||
} | ||
} | ||
`; | ||
|
||
export default staticStyles; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters