diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index a53698a..50b329e 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,24 +1,64 @@ -import React from 'react'; +import React, {useState} from 'react'; import logo from './logo.svg'; import './App.css'; +interface AddressesProps { + addressList: string[]; + setAddressListFn: any; +} + +function Addresses(props: AddressesProps) { + const [inputState, setInputState] = useState(""); + const { setAddressListFn, addressList } = props; + + const save = () => { + console.log(inputState); + //TODO check if correct address format + if (addressList.includes(inputState)) { + //Do nothing + } else { + setAddressListFn([...addressList, inputState]); + } + setInputState(""); + } + return ( +
+ setInputState(evt.target.value) } > + +
+ ); +} + +interface AddressListProps { + addressList: string[]; +}; + +function AddressList({addressList}: AddressListProps) { + + const addresses = addressList.length == 0 ? +

No addresses specified yet

: + addressList.map((addr: string) =>
{addr}
); + return ( +
+

Addresses to airdrop to:

+ { addresses } +
+ ) +} + function App() { + const [addressList, setAddressList] = useState([]); + return (
-
- logo -

- Edit src/App.tsx and save to reload. -

- - Learn React - -
+ +

Airdrop App

+ +

Add an address to airdrop to:

+ + + +
); }