diff --git a/safeshare/safeshare-frontend/src/pages/shareFile.js b/safeshare/safeshare-frontend/src/pages/shareFile.js index 2cc6118..ce68ce8 100644 --- a/safeshare/safeshare-frontend/src/pages/shareFile.js +++ b/safeshare/safeshare-frontend/src/pages/shareFile.js @@ -6,6 +6,7 @@ import { Link } from 'react-router-dom'; function ShareFile() { const [file, setFile] = useState(null); const [passcode, setPasscode] = useState(''); + const [ttl, setTtl] = useState(''); const [shareableLink, setShareableLink] = useState(''); const [notification, setNotification] = useState(''); @@ -16,7 +17,7 @@ function ShareFile() { if (file) { const formData = new FormData(); formData.append('file', file); - //formData.append('ttl', "60"); + formData.append('ttl', ttl * 24 * 60 * 60); // Send POST request to the backend API using Axios axios @@ -62,7 +63,23 @@ function ShareFile() { Back

Share a file with others!

+ + {/* TTL Input */} +
+ + setTtl(e.target.value)} + className="mt-1 p-2 w-full border rounded-md focus:ring focus:ring-opacity-50" + /> +
+ + {passcode && (