1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-21 22:11:12 +02:00

createnewmodal: refactor ui

This commit is contained in:
Kushagra Gour
2019-03-02 23:49:26 +05:30
parent 38efcf38c1
commit e42043aad7
3 changed files with 46 additions and 23 deletions

View File

@@ -2,6 +2,7 @@ import { h, Component } from 'preact';
import Modal from './Modal'; import Modal from './Modal';
import { ItemTile } from './ItemTile'; import { ItemTile } from './ItemTile';
import templates from '../templateList'; import templates from '../templateList';
import { Divider } from './common';
export class CreateNewModal extends Component { export class CreateNewModal extends Component {
render() { render() {
@@ -15,14 +16,44 @@ export class CreateNewModal extends Component {
} = this.props; } = this.props;
return ( return (
<Modal show={show} closeHandler={closeHandler}> <Modal show={show} closeHandler={closeHandler}>
<div class="tac"> <div class="flex">
<div>
<button className="btn" onClick={onBlankTemplateSelect}> <button className="btn" onClick={onBlankTemplateSelect}>
Start a blank creation Start a blank creation
</button> </button>
<p>
This gives you 3 separate panes to write HTML, CSS and JavaScript.
Good for quickly testing something.
</p>
<Divider />
Or choose from a template:
<div class="saved-items-pane__container">
{templates.map(template => (
<ItemTile
inline
item={template}
focusable
onClick={onTemplateSelect.bind(null, template)}
/>
))}
</div>
</div>
<div>
<Divider vertical />
</div>
<div>
<button className="btn" onClick={onBlankFileTemplateSelect}> <button className="btn" onClick={onBlankFileTemplateSelect}>
Start a blank files creation (beta) Start a blank creation with files (beta)
</button> </button>
<p>
Manage your code in files. Just like you would have files on your
local machine.
</p>
<Divider />
Templates coming soon!
</div>
</div>
<div class="tac">
<p> <p>
{/*<button {/*<button
className="btn" className="btn"
@@ -50,18 +81,6 @@ export class CreateNewModal extends Component {
) : null} ) : null}
</p> </p>
</div> </div>
<hr />
Or choose from a template:
<div class="saved-items-pane__container">
{templates.map(template => (
<ItemTile
inline
item={template}
focusable
onClick={onTemplateSelect.bind(null, template)}
/>
))}
</div>
</Modal> </Modal>
); );
} }

View File

@@ -34,5 +34,5 @@ export function AutoFocusInput(props) {
} }
export function Divider(props) { export function Divider(props) {
return <div class="divider" />; return <div class={`divider ${props.vertical ? 'divider--vertical' : ''}`} />;
} }

View File

@@ -218,11 +218,15 @@ label {
cursor: pointer; cursor: pointer;
} }
.divider { .divider {
margin: 10px 0; margin: 1rem 2rem;
height: 1px; height: 1px;
background: rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.15);
}
.divider--vertical {
width: 1px;
height: 100%;
margin: 2rem 1rem;
} }
[class*='hint--']:after { [class*='hint--']:after {
text-transform: none; text-transform: none;
font-weight: normal; font-weight: normal;