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`
|
||||
width: 100%;
|
||||
margin-top: 1.5rem;
|
||||
`
|
||||
|
||||
export interface TagsData {
|
||||
|
@ -43,6 +44,7 @@ const TagSelect = (props: TagSelectProps) => {
|
|||
<ThemeConsumer>
|
||||
{(currentTheme) => (
|
||||
<Select
|
||||
placeholder="Select tags..."
|
||||
theme={(theme) => ({
|
||||
...theme,
|
||||
colors: {
|
||||
|
|
|
@ -39,9 +39,18 @@ const StyledSearch = styled(MainContent)`
|
|||
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`
|
||||
width: 100%;
|
||||
line-height: 2.5rem;
|
||||
height: 2.5rem;
|
||||
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
|
||||
|
@ -50,12 +59,18 @@ const ClearDateButton = styled.button`
|
|||
font-weight: bold;
|
||||
`
|
||||
|
||||
const StyledDateRange = styled(DateRange)`
|
||||
width: 100%;
|
||||
height: 350px;
|
||||
`
|
||||
|
||||
const StyledSearchContainer = styled.div`
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
|
||||
@media screen and (max-width: ${theming.size.screen_size2}) {
|
||||
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
|
||||
function isDateInRange(
|
||||
dateToCompare: string,
|
||||
|
@ -257,7 +263,7 @@ const Search = () => {
|
|||
<h1>Search</h1>
|
||||
|
||||
<StyledSearchContainer>
|
||||
<div>
|
||||
<DateRangeControl>
|
||||
<ClearDateButton onClick={clearDate}>
|
||||
Reset range
|
||||
</ClearDateButton>
|
||||
|
@ -268,7 +274,7 @@ const Search = () => {
|
|||
ranges={dateRange}
|
||||
onChange={onDateRangeChange}
|
||||
/>
|
||||
</div>
|
||||
</DateRangeControl>
|
||||
|
||||
<StyledSearchControlContainer
|
||||
onSubmit={(event) => event.preventDefault()}
|
||||
|
@ -291,7 +297,6 @@ const Search = () => {
|
|||
/>
|
||||
{postCards.length}{" "}
|
||||
{postCards.length > 1 ? "results" : "result"}
|
||||
<h3>Tags</h3>
|
||||
<TagSelect
|
||||
query={query}
|
||||
selectedTags={selectedTags}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue