import { Button, FormLabel } from '@automattic/components'; import { createRef, PureComponent } from 'react'; import FormCheckbox from 'calypso/components/forms/form-checkbox'; import PostLikes from '../'; import PostLikesPopover from '../popover'; class PostLikesExample extends PureComponent { popoverContext = createRef(); state = { showDisplayNames: false, showPopover: false, }; toggleDisplayNames = () => { this.setState( { showDisplayNames: ! this.state.showDisplayNames, } ); }; togglePopover = () => { this.setState( { showPopover: ! this.state.showPopover, } ); }; closePopover = () => { this.setState( { showPopover: false, } ); }; render() { return (
Show display names { this.state.showPopover && ( ) }
); } } PostLikesExample.displayName = 'PostLikes'; export default PostLikesExample;