-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
74932ce
commit 2a71d3d
Showing
15 changed files
with
258 additions
and
28 deletions.
There are no files selected for viewing
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.
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.
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
132 changes: 132 additions & 0 deletions
132
src/pages/UniversalSwap/Component/ConnectBanner.module.scss
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,132 @@ | ||
@import 'src/styles/themes'; | ||
@import 'src/styles/mixins'; | ||
|
||
.connectBanner { | ||
display: flex; | ||
flex-direction: column; | ||
background: var(--Colors-Neutral-Surface-card, #18181a); | ||
border-radius: var(--Dimension-Corner-Radius-row, 8px); | ||
border: 1px solid var(--Colors-Neutral-Border-default, #383b40); | ||
|
||
.top { | ||
display: flex; | ||
padding: 24px; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 16px; | ||
align-self: stretch; | ||
|
||
border-radius: 8px 8px 0 0; | ||
|
||
background-image: url('../../../assets/images/bg_banner.png'); | ||
background-repeat: no-repeat; | ||
background-size: cover; | ||
background-position: center center; | ||
|
||
.header { | ||
display: flex; | ||
align-items: center; | ||
gap: 16px; | ||
|
||
color: var(--Colors-Neutral-Text-heading, #f7f7f7); | ||
font-size: 18px; | ||
font-weight: 600; | ||
line-height: 150%; /* 27px */ | ||
|
||
.index { | ||
color: var(--Colors-Neutral-Text-body, #b4b7bb); | ||
font-size: 18px; | ||
font-weight: 400; | ||
line-height: 150%; /* 27px */ | ||
} | ||
} | ||
|
||
.content { | ||
display: flex; | ||
align-items: center; | ||
gap: 16px; | ||
justify-content: space-between; | ||
|
||
width: 100%; | ||
|
||
.left { | ||
display: flex; | ||
align-items: center; | ||
gap: 16px; | ||
|
||
color: var(--Colors-Primary-Surface-highlight, #cbaeff); | ||
font-size: 20px; | ||
font-weight: 600; | ||
line-height: 24px; /* 120% */ | ||
|
||
.icon { | ||
position: relative; | ||
|
||
svg { | ||
z-index: 1; | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
|
||
path { | ||
stroke: #fff; | ||
} | ||
} | ||
} | ||
|
||
.connected { | ||
color: var(--Colors-Neutral-Text-title, #f7f7f7); | ||
font-family: 'IBM Plex Sans'; | ||
font-size: 16px; | ||
font-weight: 400; | ||
line-height: 24px; /* 150% */ | ||
} | ||
} | ||
|
||
.right { | ||
&.hide { | ||
visibility: hidden; | ||
} | ||
} | ||
} | ||
} | ||
|
||
.bottom { | ||
display: flex; | ||
padding: 8px 24px; | ||
align-items: center; | ||
align-self: stretch; | ||
|
||
color: var(--Colors-Neutral-Text-body, #b4b7bb); | ||
font-family: 'IBM Plex Sans'; | ||
font-size: 14px; | ||
font-weight: 400; | ||
line-height: 20px; /* 142.857% */ | ||
|
||
a { | ||
display: flex; | ||
padding: 4px 8px; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 10px; | ||
// border-radius: var(--Dimension-Corner-Radius-button, 8px); | ||
|
||
color: var(--Colors-Primary-Text-action, #b999f3); | ||
font-family: 'IBM Plex Sans'; | ||
font-size: 14px; | ||
font-weight: 500; | ||
line-height: 20px; /* 142.857% */ | ||
|
||
&:hover { | ||
opacity: 0.8; | ||
} | ||
|
||
svg { | ||
path { | ||
stroke: #b999f3; | ||
} | ||
} | ||
} | ||
} | ||
} |
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,60 @@ | ||
import React from 'react'; | ||
import styles from './ConnectBanner.module.scss'; | ||
import { ReactComponent as OpenNewTabIcon } from 'assets/icons/open_new_window.svg'; | ||
import { ReactComponent as WalletIcon } from 'assets/icons/wallet-icon.svg'; | ||
import blurIconImg from 'assets/icons/bg_blur_icon.svg'; | ||
import { WalletManagement } from 'components/WalletManagement'; | ||
import useConfigReducer from 'hooks/useConfigReducer'; | ||
import classNames from 'classnames'; | ||
import useWalletReducer from 'hooks/useWalletReducer'; | ||
import { reduceString } from 'libs/utils'; | ||
|
||
const ConnectBanner = () => { | ||
const [walletByNetworks] = useWalletReducer('walletsByNetwork'); | ||
const [oraiAddress] = useConfigReducer('address'); | ||
const [metamaskAddress] = useConfigReducer('metamaskAddress'); | ||
const [tronAddress] = useConfigReducer('tronAddress'); | ||
const [btcAddress] = useConfigReducer('btcAddress'); | ||
|
||
const connectAddress = oraiAddress || metamaskAddress || tronAddress || btcAddress || ''; | ||
|
||
const isConnected = | ||
walletByNetworks.cosmos || walletByNetworks.bitcoin || walletByNetworks.evm || walletByNetworks.tron; | ||
|
||
return ( | ||
<div className={styles.connectBanner}> | ||
<div className={styles.top}> | ||
<div className={styles.header}> | ||
<span className={styles.index}>01</span> | ||
<span>Connect with Oraichain</span> | ||
</div> | ||
<div className={styles.content}> | ||
<div className={styles.left}> | ||
<div className={styles.icon}> | ||
<img src={blurIconImg} alt="blurIconImg" /> | ||
<WalletIcon /> | ||
</div> | ||
<div className={styles.connectTitle}> | ||
<span className={classNames({ [styles.connected]: isConnected })}> | ||
{isConnected ? 'Hello,' : 'Connect wallet to'} | ||
</span> | ||
<br /> | ||
<span>{!isConnected ? 'start your Oraichain journey!' : reduceString(connectAddress, 8, 8)}</span> | ||
</div> | ||
</div> | ||
<div className={classNames(styles.right, { [styles.hide]: isConnected })}> | ||
<WalletManagement /> | ||
</div> | ||
</div> | ||
</div> | ||
<div className={styles.bottom}> | ||
<span className={styles.learn}>New to Web3? You can learn from here.</span> | ||
<a href="/" target="_blank" rel="noopener noreferrer"> | ||
Glossary <OpenNewTabIcon /> | ||
</a> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ConnectBanner; |
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
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
Oops, something went wrong.