import React from 'react'; import { Link } from 'react-router-dom'; import { Modal } from 'antd'; import { UserProposal } from 'types'; import ProfilePending from './ProfilePending'; interface OwnProps { proposals: UserProposal[]; } type Props = OwnProps; const STATE = { publishedId: null as null | UserProposal['proposalId'], }; type State = typeof STATE; class ProfilePendingList extends React.Component { state = STATE; render() { const { proposals } = this.props; const { publishedId } = this.state; return ( <> {proposals.map(p => ( ))} this.setState({ publishedId: null })} >
Your proposal is live!{' '} Click here to check it out.
); } private handlePublish = (publishedId: UserProposal['proposalId']) => { this.setState({ publishedId }); }; } export default ProfilePendingList;