diff --git a/webapp/channels/src/components/discard_changes_modal.tsx b/webapp/channels/src/components/discard_changes_modal.tsx index 90034daaa7..050f450327 100644 --- a/webapp/channels/src/components/discard_changes_modal.tsx +++ b/webapp/channels/src/components/discard_changes_modal.tsx @@ -12,45 +12,47 @@ type Props = { onCancel: (checked: boolean) => void; } -export default class DiscardChangesModal extends React.PureComponent { - public render(): JSX.Element { - const title: JSX.Element = ( - - ); +const DiscardChangesModal = ({ + show, + onConfirm, + onCancel, +}: Props) => { + const title = ( + + ); - const message: JSX.Element = ( - - ); + const message = ( + + ); - const buttonClass = 'btn btn-primary'; - const button: JSX.Element = ( - - ); + const buttonClass = 'btn btn-primary'; + const button = ( + + ); - const modalClass = 'discard-changes-modal'; + const modalClass = 'discard-changes-modal'; - const {show, onConfirm, onCancel} = this.props; + return ( + + ); +}; - return ( - - ); - } -} +export default React.memo(DiscardChangesModal);