diff --git a/client/public/avaxred.png b/client/public/avaxred.png new file mode 100644 index 0000000..73ff507 Binary files /dev/null and b/client/public/avaxred.png differ diff --git a/client/public/github.png b/client/public/github.png new file mode 100644 index 0000000..dfeb8bf Binary files /dev/null and b/client/public/github.png differ diff --git a/client/public/index.html b/client/public/index.html index cb6f6d3..4db8f44 100644 --- a/client/public/index.html +++ b/client/public/index.html @@ -6,13 +6,13 @@ - + - + diff --git a/client/src/App.tsx b/client/src/App.tsx index 8ed172f..2c09d76 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -1,4 +1,5 @@ import FaucetForm from './components/FaucetForm' +import Contribute from './components/Contribute' import axios, { config } from './configure'; import './App.css'; @@ -7,6 +8,8 @@ function App() { return (
+ +
); } diff --git a/client/src/components/Contribute.tsx b/client/src/components/Contribute.tsx new file mode 100644 index 0000000..3ae3530 --- /dev/null +++ b/client/src/components/Contribute.tsx @@ -0,0 +1,12 @@ +import './styles/Contribute.css' + +const Contribute = () => { + return ( +
{window.open('https://github.com/ava-labs/avalanche-faucet', '_blank')}}> + + Contribute on Github +
+ ) +} + +export default Contribute; \ No newline at end of file diff --git a/client/src/components/FaucetForm.tsx b/client/src/components/FaucetForm.tsx index 0a9d874..4a96d63 100644 --- a/client/src/components/FaucetForm.tsx +++ b/client/src/components/FaucetForm.tsx @@ -48,7 +48,7 @@ const FaucetForm = (props: any) => { useEffect(() => { let newOptions: any = [] - chainConfigs.forEach((chain: any, i: number) => { + chainConfigs?.forEach((chain: any, i: number) => { let item =
{ chain.NAME } @@ -84,7 +84,7 @@ const FaucetForm = (props: any) => { } async function updateBalance() { - if(chain || chain == 0) { + if((chain || chain == 0) && chainConfigs.length > 0) { const response = await props.axios.get(props.config.api.getBalance, {params: {chain: chainConfigs[chain!]?.ID}}); if(response?.data || response?.data == 0) { @@ -94,7 +94,7 @@ const FaucetForm = (props: any) => { } async function updateFaucetAddress() { - if(chain || chain == 0) { + if((chain || chain == 0) && chainConfigs.length > 0) { const response = await props.axios.get(props.config.api.faucetAddress, {params: {chain: chainConfigs[chain!]?.ID}}); if(response?.data) { @@ -258,7 +258,7 @@ const FaucetForm = (props: any) => {
- Select chain + Select Network Faucet balance: {Math.round(balance/1e9 * 100) / 100} {chainConfigs[chain!]?.TOKEN} diff --git a/client/src/components/styles/Contribute.css b/client/src/components/styles/Contribute.css new file mode 100644 index 0000000..c482c24 --- /dev/null +++ b/client/src/components/styles/Contribute.css @@ -0,0 +1,19 @@ +.contribute-button { + position: absolute; + top: 30px; + right: 20px; + padding: 10px; + cursor: pointer; + width: max-content; + display: flex; + align-items: center; + justify-content: center; + border-radius: 15px; + background-color: #333; + color: rgba(255, 255, 255, 0.7); +} + +.contribute-button:hover { + background-color: black; + color: white; +} \ No newline at end of file diff --git a/config.json b/config.json index 0d1fbd7..2909fa0 100644 --- a/config.json +++ b/config.json @@ -17,7 +17,7 @@ "RPC": "https://api.avax-test.network/ext/C/rpc", "CHAINID": 43113, "EXPLORER": "https://testnet.snowtrace.io", - "IMAGE": "https://raw.githubusercontent.com/ava-labs/avalanche-faucet/main/client/public/avax.webp", + "IMAGE": "/avaxred.png", "MAX_PRIORITY_FEE": "2000000000", "MAX_FEE": "100000000000", "DRIP_AMOUNT": 2000000000, @@ -34,7 +34,7 @@ "RPC": "https://subnets.avax.network/wagmi/wagmi-chain-testnet/rpc", "CHAINID": 11111, "EXPLORER": "https://subnets.avax.network/wagmi/wagmi-chain-testnet/explorer", - "IMAGE": "https://raw.githubusercontent.com/ava-labs/avalanche-faucet/main/client/public/wagmi.png", + "IMAGE": "/wagmi.png", "MAX_PRIORITY_FEE": "2000000000", "MAX_FEE": "100000000000", "DRIP_AMOUNT": 2000000000,