1+ import { Button } from "@mendix/widget-plugin-component-kit/Button" ;
2+ import { IconInternal } from "@mendix/widget-plugin-component-kit/IconInternal" ;
3+ import classNames from "classnames" ;
14import { createElement , ReactElement } from "react" ;
25import { Navigate , ToolbarProps } from "react-big-calendar" ;
3- import { Button } from "./Button" ;
46import "react-big-calendar/lib/css/react-big-calendar.css" ;
57
68export function CustomToolbar ( { label, localizer, onNavigate, onView, view, views } : ToolbarProps ) : ReactElement {
79 return (
810 < div className = "calendar-toolbar" >
911 < div className = "align-left btn-group" >
10- < Button onClick = { ( ) => onNavigate ( Navigate . PREVIOUS ) } >
11- < span className = "glyphicon glyphicon-backward" />
12+ < Button className = "btn btn-default" onClick = { ( ) => onNavigate ( Navigate . PREVIOUS ) } >
13+ < IconInternal icon = { { type : "glyph" , iconClass : " glyphicon-backward" } } />
1214 </ Button >
13- < Button onClick = { ( ) => onNavigate ( Navigate . TODAY ) } > { localizer . messages . today } </ Button >
14- < Button onClick = { ( ) => onNavigate ( Navigate . NEXT ) } >
15- < span className = "glyphicon glyphicon-forward" />
15+ < Button className = "btn btn-default" onClick = { ( ) => onNavigate ( Navigate . TODAY ) } >
16+ { localizer . messages . today }
17+ </ Button >
18+ < Button className = "btn btn-default" onClick = { ( ) => onNavigate ( Navigate . NEXT ) } >
19+ < IconInternal icon = { { type : "glyph" , iconClass : "glyphicon-forward" } } />
1620 </ Button >
1721 </ div >
1822
@@ -24,7 +28,11 @@ export function CustomToolbar({ label, localizer, onNavigate, onView, view, view
2428 { Array . isArray ( views ) &&
2529 views . map ( name => {
2630 return (
27- < Button key = { name } onClick = { ( ) => onView ( name ) } isActive = { view === name } >
31+ < Button
32+ key = { name }
33+ onClick = { ( ) => onView ( name ) }
34+ className = { classNames ( "btn" , "btn-default" , { active : view === name } ) }
35+ >
2836 { localizer . messages [ name ] }
2937 </ Button >
3038 ) ;
0 commit comments