diff --git a/apps/web/components/buyerAlertBox.tsx b/apps/web/components/buyerAlertBox.tsx deleted file mode 100644 index 4454fd8..0000000 --- a/apps/web/components/buyerAlertBox.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { useEffect, useState } from "react"; - -interface BuyerCardProps { - sharedState: boolean; - setSharedState: React.Dispatch>; - } - -function BuyerCard({sharedState,setSharedState}:BuyerCardProps) { - const handleClick = () => { - setSharedState(false) - console.log("onClick!") - } - - useEffect(() => { - setSharedState(true) - }, []) - - return ( -
- {sharedState && (( -
-
-
- -
-

We are using cookies for no reason.

-
-
- ))} -
- - ); -} - -export default BuyerCard; diff --git a/apps/web/components/buyerCard.tsx b/apps/web/components/buyerCard.tsx deleted file mode 100644 index ea55ff6..0000000 --- a/apps/web/components/buyerCard.tsx +++ /dev/null @@ -1,21 +0,0 @@ -interface BuyerCardProps { - sharedState: boolean; - setSharedState: React.Dispatch>; - } - -function BuyerCard({sharedState,setSharedState}:BuyerCardProps){ - return( -
- {sharedState && ( -
-
- -
- -
)} -
- ) -} -export default BuyerCard; \ No newline at end of file diff --git a/apps/web/components/buyerSubmitBox.tsx b/apps/web/components/buyerSubmitBox.tsx index 9a19cb2..3a076ed 100644 --- a/apps/web/components/buyerSubmitBox.tsx +++ b/apps/web/components/buyerSubmitBox.tsx @@ -2,16 +2,10 @@ import { useState } from 'react' import { buy } from '../service/contract'; import { getbuyList } from '../service/api'; -interface BuyerSubmitProps { - sharedState: boolean; - setSharedState: React.Dispatch>; -} - -function BuyerSubmit({sharedState,setSharedState}:BuyerSubmitProps) { +function BuyerSubmit() { const [inputValue, setInputValue] = useState(0); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); - const [dat,setData]=useState() const handleInputChange = (event:any) => { setInputValue(event.target.value); diff --git a/apps/web/components/buyerTable.tsx b/apps/web/components/buyerTable.tsx index 849135f..07991a1 100644 --- a/apps/web/components/buyerTable.tsx +++ b/apps/web/components/buyerTable.tsx @@ -1,7 +1,7 @@ import BuyerTableItem from "./buyerTableItem"; import { formatAddress } from "../utils/stringify"; -function BuyerTable() { +function BuyerTable(props: any) { const fakeData = [ { powerType: "sun", @@ -65,7 +65,7 @@ function BuyerTable() { {/* body */} - {fakeData.map((item, index) => { + {props.buyList.map((item:any, index:any) => { return ( ([]); + + useEffect(() => { + getCert('').then((res) => { + setBuyList(res); + }); + }, []); + return(

Your NFT

- +
- - +
diff --git a/apps/web/service/api.ts b/apps/web/service/api.ts index ca969d2..415c9e1 100644 --- a/apps/web/service/api.ts +++ b/apps/web/service/api.ts @@ -51,4 +51,20 @@ export async function getbuyList(amount: number) { catch (err) { console.log("error", err); } +} + +export async function getCert(account: string) { + try { + const res = await axios({ + method: 'get', + url: host + "/cert", + data: { + account: account + } + }) + return res.data; + } + catch (err) { + console.log("error", err); + } } \ No newline at end of file