Skip to content

Commit f9a0f96

Browse files
committed
Search Bar.css updated
1 parent cecbdc4 commit f9a0f96

File tree

2 files changed

+84
-68
lines changed

2 files changed

+84
-68
lines changed

src/components/SearchResults.css

Lines changed: 59 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,59 @@
1-
/* Header.css */
2-
.home-header {
3-
display: flex;
4-
justify-content: space-between;
5-
align-items: center;
6-
background-color: #f5f5f5;
7-
padding: 10px 20px;
8-
}
9-
10-
.logo {
11-
font-size: 24px;
12-
font-weight: bold;
13-
cursor: pointer;
14-
}
15-
16-
.search-container {
17-
flex-grow: 1;
18-
margin: 0 20px;
19-
}
20-
21-
.search-bar {
22-
width: 100%;
23-
padding: 8px;
24-
font-size: 16px;
25-
}
26-
27-
.header-buttons {
28-
display: flex;
29-
gap: 10px;
30-
}
31-
32-
.sign-in-button {
33-
padding: 8px 16px;
34-
font-size: 16px;
35-
cursor: pointer;
36-
background-color: #007bff;
37-
color: #fff;
38-
border: none;
39-
border-radius: 4px;
40-
}
41-
42-
.sign-in-button:hover {
43-
background-color: #0056b3;
44-
}
1+
/* Outer container */
2+
.search-results-container {
3+
display: flex;
4+
flex-direction: column;
5+
align-items: center; /* Center children horizontally */
6+
padding: 2rem;
7+
background-color: #f5f5f5;
8+
min-height: 100vh;
9+
}
10+
11+
/* Heading */
12+
.search-results-container h1 {
13+
color: #004d00;
14+
font-size: 2rem;
15+
margin-bottom: 2rem;
16+
text-align: center;
17+
}
18+
19+
/* Results list */
20+
.search-results-list {
21+
list-style: none;
22+
padding: 0;
23+
margin: 0;
24+
width: 100%;
25+
max-width: 800px; /* Restrict width for centering */
26+
}
27+
28+
/* Each result card */
29+
.search-result-item {
30+
background-color: white;
31+
border: 1px solid #ddd;
32+
border-left: 5px solid #007f3f; /* Highlight with green edge */
33+
padding: 1rem 1.5rem;
34+
margin-bottom: 1.5rem;
35+
border-radius: 8px;
36+
transition: box-shadow 0.3s ease;
37+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
38+
}
39+
40+
.search-result-item:hover {
41+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
42+
}
43+
44+
/* Title */
45+
.search-result-item h3 {
46+
margin: 0;
47+
color: #003300;
48+
font-size: 1.3rem;
49+
}
50+
51+
/* Description and field labels */
52+
.search-result-item p {
53+
margin: 0.5rem 0;
54+
color: #333;
55+
}
56+
57+
.search-result-item strong {
58+
color: #004d00;
59+
}

src/components/SearchResults.jsx

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// SearchResults.jsx
22
import React, { useEffect, useState } from 'react';
33
import { useLocation } from 'react-router-dom';
4+
import './SearchResults.css';
45

56
const SearchResults = () => {
67
const location = useLocation();
@@ -38,29 +39,29 @@ const SearchResults = () => {
3839
}
3940
}, [query]);
4041

41-
return (
42-
<div>
43-
<h1>Search Results for "{query || ''}"</h1>
44-
{loading ? (
45-
<p>Loading...</p>
46-
) : error ? (
47-
<p style={{ color: 'red' }}>{error}</p>
48-
) : results.length > 0 ? (
49-
<ul>
50-
{results.map((result) => (
51-
<li key={result.id}>
52-
<h3>{result.title || 'No Title Available'}</h3>
53-
<p>{result.body || 'No Description Available'}</p>
54-
<p><strong>Organization:</strong> {result.organization || 'N/A'}</p>
55-
<p><strong>Work Type:</strong> {result.workType || 'N/A'}</p>
56-
</li>
57-
))}
58-
</ul>
59-
) : (
60-
<p>No results found.</p>
61-
)}
62-
</div>
63-
);
64-
};
42+
return (
43+
<div className="search-results-container">
44+
<h1>Search Results for "{query || ''}"</h1>
45+
{loading ? (
46+
<p>Loading...</p>
47+
) : error ? (
48+
<p style={{ color: 'red' }}>{error}</p>
49+
) : results.length > 0 ? (
50+
<ul className="search-results-list">
51+
{results.map((result) => (
52+
<li key={result.id} className="search-result-item">
53+
<h3>{result.title || 'No Title Available'}</h3>
54+
<p>{result.body || 'No Description Available'}</p>
55+
<p><strong>Organization:</strong> {result.organization || 'N/A'}</p>
56+
<p><strong>Work Type:</strong> {result.workType || 'N/A'}</p>
57+
</li>
58+
))}
59+
</ul>
60+
) : (
61+
<p>No results found.</p>
62+
)}
63+
</div>
64+
);
65+
}
6566

6667
export default SearchResults;

0 commit comments

Comments
 (0)