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

Improved UI of search bar for search page #804

Merged
merged 3 commits into from
Jul 15, 2023
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: 34 additions & 9 deletions src/components/SearchBar/index.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,40 @@
/* search file css */
.search-bar input {
width: 30%;
}

.search-bar {
display: flex;
margin: 0px auto;
text-align: center;
align-items: center;
justify-content: center;
position:relative;
height:50px;
max-width:380px;
background:#fff;
margin: 30px auto;
border: 1px solid #e107c1;
border-radius:25px;
}
.search-input {
position: absolute;
height: 100%;
width:100%;
border-radius: 25px;
background: #fff;
border: none;
font-size: 16px;
padding-left:20px;
margin-top: -2px;
}
.search-icon{
position: absolute;
right: 0px;
top: 0;
width:54px;
background: linear-gradient(40deg, #e107c1, #59afc7);;
height: 103%;
text-align: center;
line-height:50px;
color: #fff;
font-size: 20px;
border-radius: 0 25px 25px 0;
margin-top: -2px;
}



.text-white {
color: var(--color);
Expand Down
5 changes: 5 additions & 0 deletions src/components/SearchBar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Box } from "@mui/material";
import Post from "../Post";
import ShareModal from "../../reusableComponents";
import SideBar from "../SideBar";
import { FaSearch } from "react-icons/fa";

const MemoizedPost = memo(Post);

Expand Down Expand Up @@ -69,10 +70,14 @@ function SearchBar() {
<div className="search-bar" style={{ marginTop: "-150px" }}>
<input
type="search"
className="search-input"
value={searchText}
placeholder="Search Here..."
onChange={handleSearch}
/>
<label className="search-icon">
<FaSearch/>
</label>
</div>
<Box>
<div
Expand Down
Loading