@@ -202,12 +202,7 @@ export const Calendar = forwardRef(function Calendar(
202
202
< Flex >
203
203
< Box flex = { 1 } >
204
204
< CalendarMonthSelect
205
- moveFocusedDate = { moveFocusedDate }
206
205
onChange = { handleFocusedMonthChange }
207
- labels = { {
208
- goToPreviousMonth : labels . goToPreviousMonth ,
209
- goToNextMonth : labels . goToNextMonth ,
210
- } }
211
206
monthNames = { labels . monthNames }
212
207
value = { focusedDate ?. getMonth ( ) }
213
208
/>
@@ -333,34 +328,14 @@ function CalendarTimePresetButton(props: {
333
328
}
334
329
335
330
function CalendarMonthSelect ( props : {
336
- moveFocusedDate : ( by : number ) => void
337
331
onChange : ( e : FormEvent < HTMLSelectElement > ) => void
338
332
value ?: number
339
333
monthNames : MonthNames
340
- labels : {
341
- goToPreviousMonth : string
342
- goToNextMonth : string
343
- }
344
334
} ) {
345
- const { moveFocusedDate, onChange, value, labels, monthNames} = props
346
-
347
- const handlePrevMonthClick = useCallback ( ( ) => moveFocusedDate ( - 1 ) , [ moveFocusedDate ] )
348
-
349
- const handleNextMonthClick = useCallback ( ( ) => moveFocusedDate ( 1 ) , [ moveFocusedDate ] )
335
+ const { onChange, value, monthNames} = props
350
336
351
337
return (
352
338
< Flex flex = { 1 } gap = { 1 } >
353
- < Button
354
- aria-label = { labels . goToPreviousMonth }
355
- onClick = { handlePrevMonthClick }
356
- mode = "bleed"
357
- icon = { ChevronLeftIcon }
358
- tooltipProps = { { content : 'Previous month' } }
359
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
360
- // @ts -ignore - Button with specific styling requirements
361
- { ...CALENDAR_ICON_BUTTON_PROPS }
362
- />
363
-
364
339
< Box flex = { 1 } >
365
340
< Select fontSize = { 1 } radius = { 2 } value = { value } onChange = { onChange } padding = { 2 } >
366
341
{ monthNames . map ( ( monthName , i ) => (
@@ -371,16 +346,6 @@ function CalendarMonthSelect(props: {
371
346
) ) }
372
347
</ Select >
373
348
</ Box >
374
- < Button
375
- aria-label = { labels . goToNextMonth }
376
- mode = "bleed"
377
- icon = { ChevronRightIcon }
378
- onClick = { handleNextMonthClick }
379
- tooltipProps = { { content : 'Next month' } }
380
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
381
- // @ts -ignore - Button with specific styling requirements
382
- { ...CALENDAR_ICON_BUTTON_PROPS }
383
- />
384
349
</ Flex >
385
350
)
386
351
}
0 commit comments