1
0
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:
Kushagra Gour
2018-07-09 23:25:12 +05:30
parent 66cf5ef0eb
commit f3f9bf6b08
12 changed files with 214 additions and 43 deletions

View 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>
);
}