-
Notifications
You must be signed in to change notification settings - Fork 189
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
Fix #1376: Showing BLANK with search terms return NO result #1413
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ import { Container } from '@material-ui/core'; | |
import useSiteMetadata from '../../hooks/use-site-metadata'; | ||
import Timeline from '../Posts/Timeline.jsx'; | ||
import Spinner from '../Spinner'; | ||
import NotFound from '../../images/NotFound.jpg'; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this image be put in the public folder? |
||
const useStyles = makeStyles(() => ({ | ||
spinner: { | ||
|
@@ -18,6 +19,10 @@ const useStyles = makeStyles(() => ({ | |
width: '100%', | ||
justifyContent: 'center', | ||
}, | ||
noResults: { | ||
display: 'flex', | ||
justifyContent: 'center', | ||
}, | ||
})); | ||
|
||
const SearchResults = ({ text, filter }) => { | ||
|
@@ -61,7 +66,9 @@ const SearchResults = ({ text, filter }) => { | |
{data && data.length ? ( | ||
<Timeline pages={data} nextPage={() => setSize(size + 1)} /> | ||
) : ( | ||
<h1>No search results</h1> | ||
<h1 className={classes.noResults}> | ||
<img src={NotFound} alt="Not Found" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree, I would |
||
</h1> | ||
)} | ||
</Container> | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make sure to run this image (or whichever one we end up using) through https://tinyjpg.com/ or https://tinypng.com/. For the current one, it would reduce its size by 53%:
This would positively affect our site loading speed.