I have the functional component below and want to convert it to class component could someone please help me out with that?
I want it to be something like this.
class CalendarCreateModal extends React.PureComponent {
constructor(props) {
super(props);
this.state = {.....
Right now it looks like this, below code.
const ModalData = [
{ name: "Reminders", src: CalendarCreate2, action: "Reminders" },
{ name: "Events", src: CalendarCreate3, action: "Events" },
{ name: "Programs", src: CalendarCreate4, action: "Programs" }
];
const CalendarCreateModal = ({ onClose, history, openRemindersModal }) => {
const [openModal, setOpenModal] = useState("");
const onSubmitClick = event => {
if (openModal === "Events") {
history.push("/partners/events/list");
}
if (openModal === "Programs") {
history.push("/partners/programs/list");
}
if (openModal === "Reminders") {
openRemindersModal(true);
onClose();
}
};
return (
........
)
}
export default CalendarCreateModal;