Skip to content

Commit

Permalink
Fixed buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Moore committed Jan 17, 2025
1 parent e05d52c commit 119c44e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ $cell-border-radius: 3px;
.captionEnd & {
flex-direction: row-reverse;
}

.captionStart.captionEnd & {
justify-content: space-between;
flex-direction: row;
}
}

.dayRangeStart,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const CalendarRange = ({
classNameOverride,
selected,
defaultMonth,
numberOfMonths = 2,
locale = enAU,
...restProps
}: CalendarRangeProps): JSX.Element => {
Expand All @@ -39,6 +40,7 @@ export const CalendarRange = ({
...baseCalendarClassNames,
month: hasDivider ? styles.monthWithDivider : styles.month,
caption_end: styles.captionEnd,
caption_start: styles.captionStart,
nav: styles.nav,
day_range_start: styles.dayRangeStart,
day_range_end: styles.dayRangeEnd,
Expand All @@ -57,7 +59,7 @@ export const CalendarRange = ({
IconRight: () => <Icon name="arrow_forward" isPresentational shouldMirrorInRTL />,
IconLeft: () => <Icon name="arrow_back" isPresentational shouldMirrorInRTL />,
}}
numberOfMonths={2}
numberOfMonths={numberOfMonths}
locale={locale}
{...restProps}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { type DateValidationResponse } from '~components/Filter/FilterDatePicker
import { useDateInputHandlers } from '~components/Filter/FilterDatePicker/hooks/useDateInputHandlers'
import { type DataAttributes } from '~components/types/DataAttributes'
import { type OverrideClassName } from '~components/types/OverrideClassName'
import { useMediaQueries } from '~components/utils/useMediaQueries'
import { DateRangeInputField, type DateRangeInputFieldProps } from '../DateRangeInputField'
import { filterDatePickerFieldReducer } from './filterDateRangePickerFieldReducer'
import { useEndDateValidation } from './hooks/useEndDateValidation'
Expand Down Expand Up @@ -239,6 +240,10 @@ export const FilterDateRangePickerField = ({
handleDateRangeChange({ from: newStartDate, to: newEndDate })
}

const {
queries: { isSmall },
} = useMediaQueries()

useEffect(() => {
if (inputStartDateLabel === ' ' || inputEndDateLabel === ' ') {
// Translations are loading
Expand Down Expand Up @@ -303,6 +308,7 @@ export const FilterDateRangePickerField = ({
}}
onSelect={handleCalendarSelectRange}
month={state.startMonth}
numberOfMonths={isSmall ? 1 : 2}
onMonthChange={(value: Date) => dispatch({ type: 'navigate_months', date: value })}
/>
</div>
Expand Down

0 comments on commit 119c44e

Please sign in to comment.