diff --git a/frontend/src/pages/marketplace/tabs/Rosc/CreateTab.tsx b/frontend/src/pages/marketplace/tabs/Rosc/CreateTab.tsx index 3390333..21c526f 100644 --- a/frontend/src/pages/marketplace/tabs/Rosc/CreateTab.tsx +++ b/frontend/src/pages/marketplace/tabs/Rosc/CreateTab.tsx @@ -30,7 +30,17 @@ function CreateTab() { const toggleBoxExpiry = () => { setBoxOpenExpiry(!isBoxOpenExpiry); }; - + const handleExpiryChangeDropdown = (e: any) => { + const minutes = e.target.value; + console.log(minutes); + const newDuration = { + days: 0, + hours: 0, + minutes: minutes, + seconds: 0 + }; + handleExpiryChange(newDuration); + }; const handleExpiryChange = (newDuration: { days: number; hours: number; minutes: number; seconds: number }) => { const { days, hours, minutes, seconds } = newDuration; const totalSeconds = days * 24 * 60 * 60 + hours * 60 * 60 + minutes * 60 + seconds; @@ -41,12 +51,19 @@ function CreateTab() { const handleDurationChange = (newDuration: { days: number; hours: number; minutes: number; seconds: number }) => { const { days, hours, minutes, seconds } = newDuration; const totalSeconds = days * 24 * 60 * 60 + hours * 60 * 60 + minutes * 60 + seconds; - + if (totalSeconds >= 60 && totalSeconds <= 86400) { setDuration(totalSeconds.toString()); } }; + const handleProofProbabilityChange = (e: any) => { + const value = e.target.value; + if (value === "" || (value >= 0 && value <= 99)) { + setProofProbability(value); + } + }; + function upload(cid: string) { fetch( `/api/codex/v1/storage/request/${cid}`, @@ -89,12 +106,6 @@ function CreateTab() { }); } - const handleProofProbabilityChange = (e: any) => { - const value = e.target.value; - if (value === "" || (value >= 0 && value <= 99)) { - setProofProbability(value); - } - }; return ( <> @@ -134,6 +145,15 @@ function CreateTab() { onClick={toggleBoxExpiry} /> +