mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-18 16:01:40 +03:00
b1a1f61d5d
no-issue * Used camelCase for gateway method calls * Added some components for building blocks of forms * Added input specific components * Added Form component This handles collecting the data to submit and sharing state between forms * Added Pages component to handle urls * Added the pages for the popup * Added MembersProvider component This is designed to give its children access to gateway methods * Added Modal component This wraps the pages and handles dispatching form submissions to the members gateway * Refactored index.js to use new components/pages * Fixed default page from Signup -> Signin
24 lines
802 B
JavaScript
24 lines
802 B
JavaScript
export default ({type, name, placeholder, value = '', error, onInput, required, className, children, icon}) => (
|
|
<div className="gm-form-element">
|
|
<div className="gm-input">
|
|
<input
|
|
type={ type }
|
|
name={ name }
|
|
key={ name }
|
|
placeholder={ placeholder }
|
|
value={ value }
|
|
onInput={ (e) => onInput(e, name) }
|
|
required={ required }
|
|
className={[
|
|
(value ? "gm-input-filled" : ""),
|
|
(error ? "gm-error" : ""),
|
|
className
|
|
].join(' ')}
|
|
/>
|
|
<label for={ name }>{ placeholder }</label>
|
|
<i>{ icon }</i>
|
|
{ children }
|
|
</div>
|
|
</div>
|
|
);
|