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

Add/not found #307

Merged
merged 4 commits into from
Oct 29, 2024
Merged
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
43 changes: 39 additions & 4 deletions client/src/component/Blog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import img3 from "../assets/blogs/3.png";
import img4 from "../assets/blogs/4.jpeg";
import img5 from "../assets/blogs/5.jpeg";
import img6 from "../assets/blogs/6.png";
import { Link } from 'react-router-dom';


// Dummy blog data
Expand Down Expand Up @@ -120,8 +121,8 @@ export default function BlogPage() {
key={category}
onClick={() => setSelectedCategory(category)}
className={`px-4 py-2 rounded-full text-sm font-medium transition-colors ${selectedCategory === category
? 'bg-blue-500 text-white'
: 'bg-gray-200 text-gray-700 hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-200'
? 'bg-blue-500 text-white'
: 'bg-gray-200 text-gray-700 hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-200'
}`}
>
{category}
Expand All @@ -132,7 +133,7 @@ export default function BlogPage() {

{/* Blog Grid */}
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
{filteredPosts.map(post => (
{filteredPosts.length > 0 ? filteredPosts.map(post => (
<article
key={post.id}
className="bg-white dark:bg-gray-800 rounded-xl shadow-lg overflow-hidden transform hover:scale-105 transition-transform duration-300"
Expand Down Expand Up @@ -175,7 +176,41 @@ export default function BlogPage() {
</div>
</div>
</article>
))}
))
:

<section className="bg-white ">
<div className="container flex items-center px-6 py-12 mx-auto">
<div className="flex flex-col items-center max-w-sm mx-auto text-center">
<p className="p-3 text-sm font-medium text-blue-500 rounded-full bg-blue-50 ">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth="2" stroke="currentColor" className="w-6 h-6">
<path strokeLinecap="round" strokeLinejoin="round" d="M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z" />
</svg>
</p>
<h1 className="mt-3 text-2xl font-semibold text-gray-800 md:text-3xl">Page not found</h1>
<p className="mt-4 text-gray-500 ">The page you are looking for doesnt exist. Here are some helpful links:</p>

<div className="flex items-center w-full mt-6 gap-x-3 shrink-0 sm:w-auto">
<button onClick={() => setSearchTerm('')} className="flex items-center justify-center w-1/2 px-5 py-2 text-sm text-gray-700 transition-colors duration-200 bg-white border rounded-lg gap-x-2 sm:w-auto hover:bg-gray-100 ">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor" className="w-5 h-5 rtl:rotate-180">
<path strokeLinecap="round" strokeLinejoin="round" d="M6.75 15.75L3 12m0 0l3.75-3.75M3 12h18" />
</svg>


<span >Go back</span>
</button>

<Link to={'/'} className="w-1/2 px-5 py-2 text-sm tracking-wide text-white transition-colors duration-200 bg-blue-500 rounded-lg shrink-0 sm:w-auto hover:bg-blue-600 ">
Take me home
</Link>
</div>
</div>
</div>
</section>



}
</div>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion client/src/component/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ const Footer = (props) => {
value={email}
onChange={(e) => setEmail(e.target.value)}
required
className="px-4 py-2 border border-gray-300 rounded-md w-full max-w-xs focus:outline-none text-black"
className="px-4 py-2 border border-gray-300 rounded-md w-full max-w-xs focus:outline-none"

/>
<button
type="submit"
Expand Down
2 changes: 1 addition & 1 deletion client/src/component/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ function Navbar(props) {
>
<ul className="sidebar-links">
<li>
<Link to="/" onClick={() => setIsSidebarOpen(false)}>{props.home}</Link>
<Link to="/" onClick={() => setIsSidebarOpen(false)} style={{ color: `${props}` }}>{props.home}</Link>
</li>
<li>
<Link to="/about" onClick={() => setIsSidebarOpen(false)}>{props.about}</Link>
Expand Down
2 changes: 0 additions & 2 deletions client/src/css/Navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@

.sidebar-links a {
text-decoration: none;
color: black !important;
/* Change according to your theme */
font-size: 18px;
}
Expand Down Expand Up @@ -522,7 +521,6 @@
}

.sidebar-links li a {
color: white;
text-decoration: none;
}

Expand Down