content.js
1 year ago
filters.js
1 year ago
header.js
1 year ago
import-modal.js
1 year ago
list-item.js
1 year ago
notices.js
5 years ago
pagination.js
5 years ago
preview.js
1 year ago
publish-button.js
2 years ago
template-predefine.js
2 years ago
templates-content.js
1 year ago
tpc-templates-button.js
2 years ago
tpc-templates-button.js
30 lines
| 1 | import { __ } from '@wordpress/i18n'; |
| 2 | import { Button } from '@wordpress/components'; |
| 3 | import { useState } from '@wordpress/element'; |
| 4 | import ImportModal from './import-modal'; |
| 5 | import { iconBlack as icon } from '../icon'; |
| 6 | |
| 7 | const TpcTemplatesButton = () => { |
| 8 | const [ modalOpen, setModalOpen ] = useState( false ); |
| 9 | |
| 10 | return ( |
| 11 | <> |
| 12 | <Button |
| 13 | icon={ icon } |
| 14 | isPrimary |
| 15 | onClick={ () => setModalOpen( true ) } |
| 16 | style={ { backgroundColor: '#000', margin: '0 10px' } } |
| 17 | > |
| 18 | { __( 'Templates Cloud', 'templates-patterns-collection' ) } |
| 19 | </Button> |
| 20 | <ImportModal |
| 21 | autoLoad={ false } |
| 22 | modalOpen={ modalOpen } |
| 23 | setModalOpen={ setModalOpen } |
| 24 | /> |
| 25 | </> |
| 26 | ); |
| 27 | }; |
| 28 | |
| 29 | export default TpcTemplatesButton; |
| 30 |