Skip to content

Commit

Permalink
Use functional component
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinschopf committed Mar 7, 2021
1 parent 59624fa commit 0b746a8
Showing 1 changed file with 20 additions and 28 deletions.
48 changes: 20 additions & 28 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,25 @@ type Props = {
theme?: "standard" | "bootstrap";
};

class Hours extends React.Component<Props> {
constructor(props: Props) {
super(props);
}

render() {
return (
<React.Fragment>
<FullCalendar
plugins={[interactionPlugin, dayGridPlugin]}
selectable={true}
selectOverlap={true}
select={(selectionInfo) => {
console.log(selectionInfo);
}}
locale={this.props.locale ? this.props.locale : "en"}
headerToolbar={false}
dayHeaderFormat={{
weekday: "long",
}}
themeSystem={
this.props.theme ? this.props.theme : "standard"
}
/>
</React.Fragment>
);
}
}
const Hours: React.FunctionComponent<Props> = function (props: Props) {
return (
<React.Fragment>
<FullCalendar
plugins={[interactionPlugin, dayGridPlugin]}
selectable={true}
selectOverlap={true}
select={(selectionInfo) => {
console.log(selectionInfo);
}}
locale={props.locale ? props.locale : "en"}
headerToolbar={false}
dayHeaderFormat={{
weekday: "long",
}}
themeSystem={props.theme ? props.theme : "standard"}
/>
</React.Fragment>
);
};

export default Hours;

1 comment on commit 0b746a8

@vercel
Copy link

@vercel vercel bot commented on 0b746a8 Mar 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.