Skip to content

Commit

Permalink
Update DateRangePicker styles
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyandreevsky committed Oct 18, 2024
1 parent 23dc235 commit 0a6af5a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/frontend/src/components/calendar/DateRangePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ const DateRangePicker = ({
changeHandler,
className
}) => {
const today = new Date()
const [range, setRange] = useState([null, null])
const [monthsToShow, setMonthsToShow] = useState(5)
const [currentMonthIndex, setCurrentMonthIndex] = useState(disableFutureDates ? -monthsToShow : 0)
const [showSingleCalendar, setShowSingleCalendar] = useState(window.innerWidth < 600)
const [monthPairs, setMonthPairs] = useState([])
const today = new Date()
const calendarRef = useRef(null)
const [activeStartDate, setActiveStartDate] = useState(new Date(today.getFullYear(), today.getMonth() - 1, 1))
const [displayedMonths, setDisplayedMonths] = useState([null, null])
const [monthPairs, setMonthPairs] = useState([])
const calendarRef = useRef(null)

useResizeObserver(calendarRef, (entry) => {
const containerWidth = entry.contentRect.width
Expand Down Expand Up @@ -95,6 +95,7 @@ const DateRangePicker = ({
<div
ref={calendarRef}
className={'DateRangePicker ' +
`${showSingleCalendar ? 'DateRangePicker--SingleCalendar' : ''}` +
`${className || ''} ` +
`${noTopNavigation ? 'DateRangePicker--NoTopNavigation' : ''} ` +
`${noWeekDay ? 'DateRangePicker--NoWeekDay' : ''} `}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ $font-color: #fff;
margin-bottom: 20px;
}

&--SingleCalendar & {
&__HeaderMonth {
width: 100%;
}
}

&__HeaderMonth {
width: 50%;
text-align: center;
Expand Down

0 comments on commit 0a6af5a

Please sign in to comment.