From deac1ffb6d2b2159afffd6ef9c806bafff35e35f Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Wed, 7 Dec 2022 18:47:26 -0800 Subject: [PATCH] Basic skeleton --- frontend/src/App.tsx | 70 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 55 insertions(+), 15 deletions(-) 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:

+ + + +
); }