Skip to content

Commit

Permalink
client: add search indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubham-Lal committed Apr 11, 2024
1 parent f7d8283 commit 130dd84
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
1 change: 0 additions & 1 deletion client/src/components/card/closed-debate-card.css
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@
}

#closed-card .left p {
-webkit-line-clamp: 2;
font-size: 15px;
}

Expand Down
1 change: 1 addition & 0 deletions client/src/components/sidebar/explore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const Explore: React.FC<ExploreProps> = ({ term }) => {
}}
style={{ borderColor: formSubmitted && searchTerm.trim() === "" ? "var(--body_color)" : "" }}
className={formSubmitted && searchTerm.trim() === "" ? "shake" : ""}
autoFocus={location.pathname === '/search'}
/>
</div>
<div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/sidebar/right-sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

@media screen and (max-width: 480px) {
#right-sidebar .right-sidebar__container {
padding: 0 15px;
padding: 0 10px;
display: flex;
align-items: center;
background-color: var(--nav-foot__background);
Expand Down
8 changes: 7 additions & 1 deletion client/src/pages/search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useState, useEffect } from "react";
import { useLocation, useNavigate } from "react-router-dom";
import Explore from "../../components/sidebar/explore";
import { IoMdClose } from "react-icons/io";
import { PiArrowBendUpRightBold } from "react-icons/pi";

export default function SearchPage() {
const location = useLocation();
Expand Down Expand Up @@ -30,7 +31,7 @@ export default function SearchPage() {
<div id='search'>
<Explore term={searchTerm} />

{searchTerm && (
{searchTerm ? (
<>
<div className='search-term'>
<h1>
Expand All @@ -44,6 +45,11 @@ export default function SearchPage() {
</button>
</div>
</>
) : (
<div className='search-here'>
<PiArrowBendUpRightBold size={50} />
<h2>Search here</h2>
</div>
)}
</div>
);
Expand Down
12 changes: 12 additions & 0 deletions client/src/pages/search/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,22 @@
color: var(--body_color);
}

#search .search-here {
margin-top: 60px;
width: 100%;
display: flex;
flex-direction: column;
align-items: flex-end;
}

@media screen and (max-width: 767px) {
#search #explore {
display: flex;
}

#search .search-here {
display: none;
}
}

@media screen and (max-width: 480px) {
Expand Down

0 comments on commit 130dd84

Please sign in to comment.