Skip to content

Commit

Permalink
Update package name
Browse files Browse the repository at this point in the history
  • Loading branch information
rouftom committed Sep 29, 2021
1 parent efca865 commit d4833a3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 17 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-material-scheduler",
"name": "react-mui-scheduler",
"version": "1.0.0",
"description": "React material planner is a react component based on @mui v5 that allows you to manage data in a calendar",
"description": "React material scheduler is a react component based on @mui v5 that allows you to manage data in a calendar",
"main": "dist/index.esm.js",
"directories": {
"test": "test"
Expand Down
9 changes: 7 additions & 2 deletions src/Scheduler.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ import MonthModeView from "./MonthModeView.jsx"
*/
function Scheduler(props) {
const {
events, onCellClick, onTaskClick, onEventsChange,
openAlert, alertMessage, alertProps
events,
onCellClick,
onTaskClick,
onEventsChange,
openAlert,
alertMessage,
alertProps
} = props
const today = new Date()
const theme = useTheme()
Expand Down
36 changes: 23 additions & 13 deletions src/Toolbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import ToolbarSearchbar from "./ToolbarSeachBar.jsx"
function SchedulerToolbar (props) {
const {
// events data
events, today,
events, today, toolbarProps,
// Mode
onModeChange, onSearchResult,
// Alert props
Expand Down Expand Up @@ -141,6 +141,7 @@ function SchedulerToolbar (props) {
component="div"
sx={{m: .5, display: 'flex', alignItems: 'center'}}
>
{toolbarProps.showDatePicker &&
<Typography component="div" sx={{ flexGrow: 1 }}>
<Hidden smDown>
<IconButton
Expand All @@ -150,13 +151,6 @@ function SchedulerToolbar (props) {
>
<ChevronLeftIcon />
</IconButton>
<IconButton
sx={{ mr: 2 }}
{...commonIconButtonProps}
onClick={() => handleChangeDate(add)}
>
<ChevronRightIcon />
</IconButton>
<Button
size="medium"
id="basic-button"
Expand All @@ -168,6 +162,13 @@ function SchedulerToolbar (props) {
>
{format(selectedDate, 'MMMM-yyyy')}
</Button>
<IconButton
sx={{ mr: 2 }}
{...commonIconButtonProps}
onClick={() => handleChangeDate(add)}
>
<ChevronRightIcon />
</IconButton>
</Hidden>
<Hidden smUp>
<IconButton{...commonIconButtonProps} onClick={handleOpenDateSelector}>
Expand All @@ -194,11 +195,12 @@ function SchedulerToolbar (props) {
/>
</LocalizationProvider>
</Menu>
</Typography>
</Typography>}
<Typography
component="div"
sx={{display: 'inline-flex', alignItems: 'center'}}
>
{toolbarProps?.showSearchBar &&
<ToolbarSearchbar
events={events}
onInputChange={(newValue) => {
Expand All @@ -207,7 +209,8 @@ function SchedulerToolbar (props) {
setSelectedDate(newDate)
setSearchResult(newValue)
}}
/>
/>}
{toolbarProps?.showSwitchModeButtons &&
<ToggleButtonGroup
exclusive
disabled
Expand All @@ -220,10 +223,11 @@ function SchedulerToolbar (props) {
{['month', 'Week', 'Day'].map(tb => (
<ToggleButton key={tb} value={tb}>{tb}</ToggleButton>
))}
</ToggleButtonGroup>
</ToggleButtonGroup>}
{toolbarProps?.showOptions &&
<IconButton sx={{ ml: 1 }} onClick={handleOpenMenu}{...commonIconButtonProps}>
<MoreVertIcon />
</IconButton>
</IconButton>}
</Typography>
</Typography>
<Menu
Expand Down Expand Up @@ -272,7 +276,13 @@ SchedulerToolbar.propTypes = {
SchedulerToolbar.defaultProps = {
openAlert: false,
alertMessage: 'This is a scheduler alert',
alertProps: {color: 'info', severity: 'info'}
alertProps: {color: 'info', severity: 'info'},
toolbarProps: {
showSearchBar: true,
showSwitchModeButtons: true,
showDatePicker: true,
showOptions: true
}
}

export default SchedulerToolbar

0 comments on commit d4833a3

Please sign in to comment.