From fc19d729ca96df1484ee31d176299d6f70f4ad5c Mon Sep 17 00:00:00 2001 From: Vinay Anand Lodhi Date: Thu, 7 Nov 2024 23:33:59 +0530 Subject: [PATCH] Upload project UI changes --- client/src/component/Faq.jsx | 20 +-- client/src/component/UploadProject.jsx | 198 ++++++++++++++----------- 2 files changed, 118 insertions(+), 100 deletions(-) diff --git a/client/src/component/Faq.jsx b/client/src/component/Faq.jsx index 541d836..ae2e048 100644 --- a/client/src/component/Faq.jsx +++ b/client/src/component/Faq.jsx @@ -1,6 +1,6 @@ // component/FAQ.jsx -import { useState } from "react"; -import "../css/Faq.css"; +import React, { useState } from 'react'; +import './FAQ.css'; // Import the CSS file for styling const FAQ = () => { const [activeIndex, setActiveIndex] = useState(null); @@ -27,29 +27,25 @@ const FAQ = () => { const faqData = [ { question: "What is BitBox?", - answer: - "BitBox is a user-friendly platform that simplifies version control and collaboration for developers.", + answer: "BitBox is a user-friendly platform that simplifies version control and collaboration for developers.", }, { question: "How does BitBox enhance collaboration?", - answer: - "BitBox offers intuitive tools that enable both solo programmers and large teams to manage projects efficiently.", + answer: "BitBox offers intuitive tools that enable both solo programmers and large teams to manage projects efficiently.", }, { question: "How do I get started with BitBox?", - answer: - "You can sign up for an account on BitBox and start managing your projects right away.", + answer: "You can sign up for an account on BitBox and start managing your projects right away.", }, { question: "Is BitBox compatible with modern development workflows?", - answer: - "Yes, BitBox seamlessly integrates with modern development workflows, providing fast and reliable performance.", + answer: "Yes, BitBox seamlessly integrates with modern development workflows, providing fast and reliable performance.", }, { question: "How can I contact support if I need help?", - answer: - "You can reach out to support through the 'Contact Us' page or by emailing support@example.com.", + answer: "You can reach out to support through the 'Contact Us' page or by emailing support@example.com.", }, ]; + export default FAQ; diff --git a/client/src/component/UploadProject.jsx b/client/src/component/UploadProject.jsx index b79b50a..cd70f65 100644 --- a/client/src/component/UploadProject.jsx +++ b/client/src/component/UploadProject.jsx @@ -2,7 +2,6 @@ import React, { useState } from 'react'; import PropTypes from "prop-types"; import { useNavigate } from 'react-router-dom'; - const UploadProject = ({ mode }) => { const navigate = useNavigate(); const [formData, setFormData] = useState({ @@ -12,6 +11,7 @@ const UploadProject = ({ mode }) => { deploymentLink: '', projectFiles: null, }); + const [isModalOpen, setIsModalOpen] = useState(false); const handleChange = (e) => { const { name, value, type, files } = e.target; @@ -48,7 +48,6 @@ const UploadProject = ({ mode }) => { console.log('Project submitted successfully:', data); navigate('/projects'); - // Clear the form after submission setFormData({ title: '', description: '', @@ -56,7 +55,6 @@ const UploadProject = ({ mode }) => { deploymentLink: '', }); - // Optionally, you can redirect the user or display a success message } catch (error) { console.error('Error submitting project:', error); } @@ -65,99 +63,123 @@ const UploadProject = ({ mode }) => { const themeStyles = mode === 'dark' ? 'bg-gray-800 text-white' : 'bg-white text-gray-900'; return ( -
-

- Upload Your Project -

- -
- {/* Project Title */} -
- - -
- - {/* Project Description */} -
- - -
- - {/* GitHub Link */} -
- - -
- - {/* Deployment Link */} -
- - -
- - - - {/* Submit Button */} -
- + + {/* Modal Overlay */} + {isModalOpen && ( +
+ {/* Modal Content */} +
- Upload Project - + {/* Close Button in Top Right */} + + +

+ Upload Your Project +

+ + + {/* Project Title */} +
+ + +
+ + {/* Project Description */} +
+ + +
+ + {/* GitHub Link */} +
+ + +
+ + {/* Deployment Link */} +
+ + +
+ + {/* Submit Button */} +
+ +
+ +
- + )}
); }; UploadProject.propTypes = { - mode: PropTypes.string, - }; export default UploadProject;