-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: arbitrum stylus migration (#56)
- Loading branch information
1 parent
a7ab99e
commit c3fa81e
Showing
2 changed files
with
27 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,19 @@ | ||
import { useEffect, useState } from 'react'; | ||
import { MetamaskConnect } from './MetamaskConnect'; | ||
import { Project } from './Project'; | ||
import { Client } from '@remixproject/plugin'; | ||
import { Api } from '@remixproject/plugin-utils'; | ||
import { IRemixApi } from '@remixproject/plugin-api'; | ||
import { Connect as CommonConnect } from '../common/Connect'; | ||
import { ARBITRUM_ONE_CHAIN, ARBITRUM_SEPOLIA_CHAIN } from './const'; | ||
|
||
interface InterfaceProps { | ||
client: Client<Api, Readonly<IRemixApi>>; | ||
} | ||
|
||
export const Connect: React.FunctionComponent<InterfaceProps> = ({ client }) => { | ||
const [wallet, setWallet] = useState(''); | ||
const [account, setAccount] = useState(''); | ||
const [injectedProvider, setInjectedProvider] = useState(); | ||
const [providerNetwork, setProviderNetwork] = useState<string>('neutron-1'); | ||
const [active, setActive] = useState<boolean>(false); | ||
|
||
export const Connect = () => { | ||
return ( | ||
<div> | ||
<CommonConnect | ||
client={client} | ||
active={active} | ||
setActive={setActive} | ||
chain={'arbitrum'} | ||
setWallet={setWallet} | ||
wallet={wallet} | ||
/> | ||
<div style={{ height: '0.7em' }}></div> | ||
<div> | ||
<MetamaskConnect | ||
active={active} | ||
account={account} | ||
setAccount={setAccount} | ||
client={client} | ||
setActive={setActive} | ||
setInjectedProvider={setInjectedProvider} | ||
setProviderNetwork={setProviderNetwork} | ||
/> | ||
{[ARBITRUM_SEPOLIA_CHAIN.chainId, ARBITRUM_ONE_CHAIN.chainId].includes(providerNetwork) ? ( | ||
<Project | ||
account={account} | ||
injectedProvider={injectedProvider} | ||
client={client} | ||
providerNetwork={providerNetwork} | ||
/> | ||
) : null} | ||
</div> | ||
<p> | ||
The Arbitrum code compiler has been separated into <b>ARBITRUM STYLUS</b> plugin. | ||
<br /> | ||
<br /> | ||
You can activate Arbitrum Stylus in the plugin manager or access it through this{' '} | ||
<a | ||
href="https://remix.ethereum.org/#activate=arbitrum-stylus" | ||
target="_blank" | ||
rel="noreferrer" | ||
> | ||
link | ||
</a> | ||
</p> | ||
</div> | ||
); | ||
}; |