diff --git a/src/App.jsx b/src/App.jsx index 1314f76..f3c5be9 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -2,6 +2,7 @@ import React from 'react' import './App.css' import HomePage from './components/HomePage' import PricingPage from './components/PricingPage' +import ContactUsPage from './components/ContactUsPage' import { Route, Routes } from "react-router-dom" function App() { @@ -9,6 +10,7 @@ function App() { } /> } /> + } /> ) } diff --git a/src/components/ContactUs/ContactUs.css b/src/components/ContactUs/ContactUs.css new file mode 100644 index 0000000..47e0789 --- /dev/null +++ b/src/components/ContactUs/ContactUs.css @@ -0,0 +1,78 @@ +.contact-us { + max-width: 600px; + margin: 100px ; + margin-left: 350px; + padding: 20px; + background-color: #f9f9f9; + border-radius: 8px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + } + + .contact-us h2 { + text-align: center; + margin-bottom: 20px; + font-family: Poppins, sans-serif; + font-weight: bolder; + font-size: xx-large; + } + + .form-group { + margin-bottom: 15px; + } + + .form-group label { + display: block; + margin-bottom: 5px; + } + + .form-group input, + .form-group textarea { + width: 100%; + padding: 10px; + border: 1px solid #ccc; + border-radius: 4px; + } + + .form-group textarea { + resize: vertical; + height: 100px; + } + + .star-rating { + display: flex; + gap: 5px; + } + + .star { + font-size: 24px; + cursor: pointer; + color: #ccc; + transition: color 0.3s ease; + } + + .star.filled, + .star.hover { + color: #ffc107; + } + + button { + display: block; + width: 100%; + padding: 10px; + background-color: #28a745; + color: white; + border: none; + border-radius: 4px; + cursor: pointer; + } + + button:hover { + background-color: #218838; + } + + .form-status { + text-align: center; + margin-top: 20px; + color: green; + } + \ No newline at end of file diff --git a/src/components/ContactUs/ContactUs.jsx b/src/components/ContactUs/ContactUs.jsx new file mode 100644 index 0000000..81068c6 --- /dev/null +++ b/src/components/ContactUs/ContactUs.jsx @@ -0,0 +1,117 @@ +import React, { useState } from 'react'; +import './ContactUs.css'; + +const ContactUs = () => { + const [formData, setFormData] = useState({ + name: '', + email: '', + subject: '', + message: '', + rating: 0 + }); + + const [formStatus, setFormStatus] = useState(''); + const [hoverRating, setHoverRating] = useState(0); + + const handleChange = (e) => { + setFormData({ + ...formData, + [e.target.name]: e.target.value + }); + }; + + const handleRatingChange = (rating) => { + setFormData({ + ...formData, + rating + }); + }; + + const handleSubmit = (e) => { + e.preventDefault(); + + // Here you would handle the form submission to your backend or email service + console.log('Form Data Submitted:', formData); + + // For now, let's just reset the form and show a success message + setFormData({ + name: '', + email: '', + subject: '', + message: '', + rating: 0 + }); + setFormStatus('Thank you for contacting us! We will get back to you soon.'); + }; + + return ( +
+

Contact Us

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ {[1, 2, 3, 4, 5].map((star) => ( + = star ? 'filled' : ''} ${hoverRating >= star ? 'hover' : ''}`} + onClick={() => handleRatingChange(star)} + onMouseEnter={() => setHoverRating(star)} + onMouseLeave={() => setHoverRating(0)} + > + ★ + + ))} +
+
+ +
+ {formStatus &&

{formStatus}

} +
+ ); +}; + +export default ContactUs; diff --git a/src/components/ContactUs/ContactUs.scss b/src/components/ContactUs/ContactUs.scss new file mode 100644 index 0000000..2af1d67 --- /dev/null +++ b/src/components/ContactUs/ContactUs.scss @@ -0,0 +1,74 @@ +.contact-us { + max-width: 600px; + margin: 0 auto; + padding: 20px; + background-color: #f9f9f9; + border-radius: 8px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + + h2 { + text-align: center; + margin-bottom: 20px; + } + + .form-group { + margin-bottom: 15px; + + label { + display: block; + margin-bottom: 5px; + } + + input, + textarea { + width: 100%; + padding: 10px; + border: 1px solid #ccc; + border-radius: 4px; + } + + textarea { + resize: vertical; + height: 100px; + } + } + + .star-rating { + display: flex; + gap: 5px; + + .star { + font-size: 24px; + cursor: pointer; + color: #ccc; + transition: color 0.3s ease; + + &.filled, + &.hover { + color: #ffc107; + } + } + } + + button { + display: block; + width: 100%; + padding: 10px; + background-color: #28a745; + color: white; + border: none; + border-radius: 4px; + cursor: pointer; + + &:hover { + background-color: #218838; + } + } + + .form-status { + text-align: center; + margin-top: 20px; + color: green; + } + } + \ No newline at end of file diff --git a/src/components/ContactUsPage.jsx b/src/components/ContactUsPage.jsx new file mode 100644 index 0000000..30f7380 --- /dev/null +++ b/src/components/ContactUsPage.jsx @@ -0,0 +1,15 @@ +import React from 'react' +import Navbar from './Navbar/Navbar' +import ContactUs from './ContactUs/ContactUs' + + +function HomePage(props) { + return ( + <> + + + + ) +} + +export default HomePage \ No newline at end of file diff --git a/src/components/HomePage.jsx b/src/components/HomePage.jsx index 797265b..122187a 100644 --- a/src/components/HomePage.jsx +++ b/src/components/HomePage.jsx @@ -3,6 +3,7 @@ import Navbar from './Navbar/Navbar' import Homebox from './Homebox/Homebox' import Contentbox from './Contentbox/Contentbox' + function HomePage(props) { return ( <> diff --git a/src/components/Navbar/Navbar.jsx b/src/components/Navbar/Navbar.jsx index 6967413..96066fa 100644 --- a/src/components/Navbar/Navbar.jsx +++ b/src/components/Navbar/Navbar.jsx @@ -64,11 +64,16 @@ const Navbar = () => { > Github + + isPending ? "active " : isActive ? "activepage" : "" + } to="/ContactUs"> + ContactUs +
- - + +