Skip to content

Commit

Permalink
Merge pull request DimensionDev#101 from ironsoul0/master
Browse files Browse the repository at this point in the history
feat: add faucetAvailable boolean
  • Loading branch information
austintgriffith authored Feb 10, 2021
2 parents 1745776 + 0873c4a commit 84d5fd5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/react-app/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@ function App(props) {
}, [setRoute]);

let faucetHint = ""
const faucetAvailable = localProvider && localProvider.connection && localProvider.connection.url && localProvider.connection.url.indexOf(window.location.hostname)>=0 && !process.env.REACT_APP_PROVIDER && price > 1;

const [ faucetClicked, setFaucetClicked ] = useState( false );
if(!faucetClicked&&localProvider&&localProvider._network&&localProvider._network.chainId==31337&&yourLocalBalance&&formatEther(yourLocalBalance)<=0){
if(!faucetClicked&&faucetAvailable){
faucetHint = (
<div style={{padding:16}}>
<Button type={"primary"} onClick={()=>{
Expand Down Expand Up @@ -324,7 +326,7 @@ function App(props) {
{

/* if the local provider has a signer, let's show the faucet: */
localProvider && localProvider.connection && localProvider.connection.url && localProvider.connection.url.indexOf(window.location.hostname)>=0 && !process.env.REACT_APP_PROVIDER && price > 1 ? (
faucetAvailable ? (
<Faucet localProvider={localProvider} price={price} ensProvider={mainnetProvider}/>
) : (
""
Expand Down

0 comments on commit 84d5fd5

Please sign in to comment.