Skip to content

Instantly share code, notes, and snippets.

@leanazulyoro
Last active July 16, 2019 20:43
Show Gist options
  • Save leanazulyoro/8de05407c6913742fab9f162624e185f to your computer and use it in GitHub Desktop.
Save leanazulyoro/8de05407c6913742fab9f162624e185f to your computer and use it in GitHub Desktop.
LeadListWithModals refactored with custom hooks
import React from 'react';
import { useRevisionModal, useTrackingModal } from '../../hooks/modals';
const LeadListWithModals = ({ leads }) => {
const [handleRevisionRequest, revisionModal] = useRevisionModal();
const [handleLeadStatusChange, trackingModal] = useTrackingModal();
return (
<>
<LeadList
leads={leads}
onStatusChange={handleLeadStatusChange}
onRevisionRequest={handleRevisionRequest}
/>
{revisionModal}
{trackingModal}
</>
);
};
export default LeadListWithModals;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment