Skip to content

Commit

Permalink
Merge pull request #198 from G7DAO/feat/network-toggle
Browse files Browse the repository at this point in the history
navigate to bridge if on faucet and switch to mainnet
  • Loading branch information
elclandestin0 authored Nov 21, 2024
2 parents 40a04b2 + 7a6ce22 commit 85b41c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { useUISettings } from '@/contexts/UISettingsContext'
import { useFaucetAPI } from '@/hooks/useFaucetAPI'
import { TransactionRecord } from '@/utils/bridge/depositERC20ArbitrumSDK'
import { timeDifferenceInHoursAndMinutes, timeDifferenceInHoursMinutesAndSeconds } from '@/utils/timeFormat'
import { useNavigate } from 'react-router-dom'

interface FaucetViewProps {}
const FaucetView: React.FC<FaucetViewProps> = ({}) => {
Expand All @@ -28,10 +29,16 @@ const FaucetView: React.FC<FaucetViewProps> = ({}) => {
const { faucetTargetChainId } = useUISettings()
const { refetchNewNotifications } = useBridgeNotificationsContext()
const smallView = useMediaQuery('(max-width: 1199px)')
const navigate = useNavigate()

const values: AccountType[] = [`External Address`, `Connected Account`]
const networks = getNetworks(selectedNetworkType)

if (selectedNetworkType === 'Mainnet') {
navigate('/bridge')
}


useEffect(() => {
const targetNetwork = networks?.find((n) => n.chainId === faucetTargetChainId)
if (targetNetwork) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,6 @@ const BridgePage = () => {
</div>
</div>
<div className={styles.viewContainer}>
{/* TODO: make into component. */}
{/* <div className={styles.warningWrapper}>
<div className={styles.warningContainer}>
<div className={styles.warningBadge}>Warning</div>
<div
className={styles.warningText}
>{`This faucet only dispenses ${L3_NATIVE_TOKEN_SYMBOL} tokens. For other tokens, please visit external faucets.`}</div>
</div>
</div> */}

<FaucetView />
</div>
</div>
Expand Down

0 comments on commit 85b41c5

Please sign in to comment.