fixed reset date range button style
Fixed reset date range button css on smaller displays
This commit is contained in:
parent
3f4e244384
commit
150311472e
2 changed files with 20 additions and 13 deletions
|
@ -12,6 +12,7 @@ const map: Map = _map
|
||||||
|
|
||||||
const StyledReactTagsContainer = styled.div`
|
const StyledReactTagsContainer = styled.div`
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
margin-top: 1.5rem;
|
||||||
`
|
`
|
||||||
|
|
||||||
export interface TagsData {
|
export interface TagsData {
|
||||||
|
@ -43,6 +44,7 @@ const TagSelect = (props: TagSelectProps) => {
|
||||||
<ThemeConsumer>
|
<ThemeConsumer>
|
||||||
{(currentTheme) => (
|
{(currentTheme) => (
|
||||||
<Select
|
<Select
|
||||||
|
placeholder="Select tags..."
|
||||||
theme={(theme) => ({
|
theme={(theme) => ({
|
||||||
...theme,
|
...theme,
|
||||||
colors: {
|
colors: {
|
||||||
|
|
|
@ -39,9 +39,18 @@ const StyledSearch = styled(MainContent)`
|
||||||
text-align: center;
|
text-align: center;
|
||||||
`
|
`
|
||||||
|
|
||||||
|
const DateRangeControl = styled.div`
|
||||||
|
width: 350px;
|
||||||
|
|
||||||
|
@media screen and (max-width: ${theming.size.screen_size2}) {
|
||||||
|
margin-top: 2rem;
|
||||||
|
}
|
||||||
|
`
|
||||||
|
|
||||||
const ClearDateButton = styled.button`
|
const ClearDateButton = styled.button`
|
||||||
width: 100%;
|
width: 100%;
|
||||||
line-height: 2.5rem;
|
height: 2.5rem;
|
||||||
|
|
||||||
border: none;
|
border: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
@ -50,12 +59,18 @@ const ClearDateButton = styled.button`
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
`
|
`
|
||||||
|
|
||||||
|
const StyledDateRange = styled(DateRange)`
|
||||||
|
width: 100%;
|
||||||
|
height: 350px;
|
||||||
|
`
|
||||||
|
|
||||||
const StyledSearchContainer = styled.div`
|
const StyledSearchContainer = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
|
||||||
@media screen and (max-width: ${theming.size.screen_size2}) {
|
@media screen and (max-width: ${theming.size.screen_size2}) {
|
||||||
flex-direction: column-reverse;
|
flex-direction: column-reverse;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
|
@ -69,15 +84,6 @@ const StyledSearchControlContainer = styled.div`
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
const StyledDateRange = styled(DateRange)`
|
|
||||||
width: 350px;
|
|
||||||
height: 350px;
|
|
||||||
|
|
||||||
@media screen and (max-width: ${theming.size.screen_size2}) {
|
|
||||||
margin-top: 1rem;
|
|
||||||
}
|
|
||||||
`
|
|
||||||
|
|
||||||
// check if post date is withing the range
|
// check if post date is withing the range
|
||||||
function isDateInRange(
|
function isDateInRange(
|
||||||
dateToCompare: string,
|
dateToCompare: string,
|
||||||
|
@ -257,7 +263,7 @@ const Search = () => {
|
||||||
<h1>Search</h1>
|
<h1>Search</h1>
|
||||||
|
|
||||||
<StyledSearchContainer>
|
<StyledSearchContainer>
|
||||||
<div>
|
<DateRangeControl>
|
||||||
<ClearDateButton onClick={clearDate}>
|
<ClearDateButton onClick={clearDate}>
|
||||||
Reset range
|
Reset range
|
||||||
</ClearDateButton>
|
</ClearDateButton>
|
||||||
|
@ -268,7 +274,7 @@ const Search = () => {
|
||||||
ranges={dateRange}
|
ranges={dateRange}
|
||||||
onChange={onDateRangeChange}
|
onChange={onDateRangeChange}
|
||||||
/>
|
/>
|
||||||
</div>
|
</DateRangeControl>
|
||||||
|
|
||||||
<StyledSearchControlContainer
|
<StyledSearchControlContainer
|
||||||
onSubmit={(event) => event.preventDefault()}
|
onSubmit={(event) => event.preventDefault()}
|
||||||
|
@ -291,7 +297,6 @@ const Search = () => {
|
||||||
/>
|
/>
|
||||||
{postCards.length}{" "}
|
{postCards.length}{" "}
|
||||||
{postCards.length > 1 ? "results" : "result"}
|
{postCards.length > 1 ? "results" : "result"}
|
||||||
<h3>Tags</h3>
|
|
||||||
<TagSelect
|
<TagSelect
|
||||||
query={query}
|
query={query}
|
||||||
selectedTags={selectedTags}
|
selectedTags={selectedTags}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue