Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Contact and Register Routing #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^5.0.1",
"react-router-dom": "^6.22.3"
"react-router-dom": "^6.22.3",
"react-router-hash-link": "^2.4.3"
},
"devDependencies": {
"@types/react": "^18.2.66",
Expand Down
2 changes: 1 addition & 1 deletion client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function App() {
<Routes>
<Route path="/" element={<Home />} />
<Route path="/about" element={<About />} />
<Route path="/contact" element={<Contact />} />
{/* <Route path="/contact" element={<Contact />} /> */}
<Route path="dashboard" element={<Dashboard />} />
<Route path="project" element={<Projects />} />
<Route path="/login" element={<Login />} />
Expand Down
7 changes: 7 additions & 0 deletions client/src/components/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Button, Navbar, TextInput } from "flowbite-react";
import { Link, useLocation } from "react-router-dom";
import { HashLink } from 'react-router-hash-link';
import { AiOutlineSearch } from "react-icons/ai";
import { FaMoon } from "react-icons/fa";
export default function Header() {
Expand Down Expand Up @@ -50,6 +51,12 @@ export default function Header() {
<Navbar.Link active={path === "/project"} as={"div"}>
<Link to="/project">Project</Link>
</Navbar.Link>
<Navbar.Link active={path === "/about#contact_us"} as={"div"}>
<HashLink to="/about#contact_us">Contact Us</HashLink>
</Navbar.Link>
<Navbar.Link active={path === "/register"} as={"div"}>
<Link to="/register">Register</Link>
</Navbar.Link>
</Navbar.Collapse>
</Navbar>
);
Expand Down
20 changes: 3 additions & 17 deletions client/src/pages/About.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Contact from "./Contact";

export default function About() {
return (
<div className="max-w-6xl mx-auto px-5 py-10">
Expand Down Expand Up @@ -34,23 +36,7 @@ export default function About() {
</div>
</div>

<div className="text-center mt-10">
<h2 className="text-2xl font-semibold mb-3">Contact Us</h2>
<div className="flex justify-center items-center space-x-4">
<a
href="mailto:[email protected]"
className="text-gray-500 hover:text-gray-700 transition-colors duration-300"
>
Email
</a>
<a
href="https://twitter.com/OurCompany"
className="text-gray-500 hover:text-gray-700 transition-colors duration-300"
>
Twitter
</a>
</div>
</div>
<Contact />
</div>
);
}
18 changes: 17 additions & 1 deletion client/src/pages/Contact.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@

export default function Contact() {
return (
<div>Contact</div>
<div className="text-center mt-10">
<h2 className="text-2xl font-semibold mb-3" id="contact_us">Contact Us</h2>
<div className="flex justify-center items-center space-x-4">
<a
href="mailto:[email protected]"
className="text-gray-500 hover:text-gray-700 transition-colors duration-300"
>
Email
</a>
<a
href="https://twitter.com/OurCompany"
className="text-gray-500 hover:text-gray-700 transition-colors duration-300"
>
Twitter
</a>
</div>
</div>
)
}