-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(search): close with menu button + tabs + No result fount elem…
…ent (#125) * feat: add no results found components * feat: handle close search with menu button + tabs
- Loading branch information
1 parent
84eef6d
commit 61e9867
Showing
10 changed files
with
173 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import Lottie from "lottie-react"; | ||
import styled from "styled-components"; | ||
import noResultsAnimation from "@data/animations/not_found.json"; | ||
|
||
const NoResultsContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
height: 100%; | ||
padding-bottom: 2rem; | ||
`; | ||
|
||
const NoResultsIcon = styled.div` | ||
--icon-size: 8rem; | ||
width: var(--icon-size); | ||
height: var(--icon-size); | ||
`; | ||
|
||
const NoResultsText = styled.p` | ||
font-size: 1.5rem; | ||
font-weight: 500; | ||
color: var(--color-text-secondary); | ||
`; | ||
|
||
const NoResultsSubText = styled.p` | ||
font-size: 1rem; | ||
font-weight: 400; | ||
color: var(--color-text-secondary); | ||
`; | ||
|
||
const NoResultsFound: React.FC = () => { | ||
return ( | ||
<NoResultsContainer> | ||
<NoResultsIcon> | ||
<Lottie animationData={noResultsAnimation} /> | ||
</NoResultsIcon> | ||
<NoResultsText>No results found</NoResultsText> | ||
<NoResultsSubText>Try searching for something else</NoResultsSubText> | ||
</NoResultsContainer> | ||
); | ||
}; | ||
|
||
export default NoResultsFound; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { RootState } from "@state/store"; | ||
import { useSelector } from "react-redux"; | ||
import MessageResult from "../result-items/MessageResult"; | ||
import NoResultsFound from "../NoResultsFound"; | ||
|
||
const MESSAGES = [ | ||
{ | ||
title: "Telware Testing", | ||
date: new Date().toString(), | ||
image: "https://placecats.com/200/200", | ||
message: "Hello hi there", | ||
}, | ||
]; | ||
|
||
const MessagesTab: React.FC = () => { | ||
const { searchTerm } = useSelector((state: RootState) => state.globalSearch); | ||
|
||
return ( | ||
<div style={{ height: "100%" }}> | ||
{MESSAGES.length === 0 && <NoResultsFound />} | ||
{MESSAGES.map((message) => ( | ||
<MessageResult | ||
searchTerm={searchTerm} | ||
message={message.message} | ||
title={message.title} | ||
date={message.date} | ||
image={message.image} | ||
/> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default MessagesTab; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters