mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-29 01:30:16 +02:00
add support for templates
This commit is contained in:
32
src/components/CreateNewModal.jsx
Normal file
32
src/components/CreateNewModal.jsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import { h } from 'preact';
|
||||
import Modal from './Modal';
|
||||
import { ItemTile } from './ItemTile';
|
||||
import templates from '../templateList';
|
||||
|
||||
export function CreateNewModal({
|
||||
show,
|
||||
closeHandler,
|
||||
onBlankTemplateSelect,
|
||||
onTemplateSelect
|
||||
}) {
|
||||
return (
|
||||
<Modal show={show} closeHandler={closeHandler} smll>
|
||||
<div class="tac">
|
||||
<button className="btn" onClick={onBlankTemplateSelect}>
|
||||
Start a blank creation
|
||||
</button>
|
||||
</div>
|
||||
<hr />
|
||||
Or choose from a template:
|
||||
<div class="saved-items-pane__container">
|
||||
{templates.map(template => (
|
||||
<ItemTile
|
||||
item={template}
|
||||
focusable
|
||||
onClick={onTemplateSelect.bind(null, template)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user