This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ember install ember-simple-auth |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd auth-example-frontend |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ ember new auth-example-frontend | |
installing app | |
create .editorconfig | |
create .ember-cli | |
create .eslintrc.js | |
create .travis.yml | |
create .watchmanconfig | |
create README.md | |
create app/app.js | |
create app/components/.gitkeep |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ember new auth-example-frontend |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import Form from './Form'; | |
import EmailField from './EmailField'; | |
class App extends Component { | |
onValidEmail = () => {} | |
onInvalidEmail = () => {} | |
render() { | |
return( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import Form from './Form'; | |
class App extends Component { | |
onValidEmail = () => {} | |
onInvalidEmail = () => {} | |
render() { | |
return ( | |
<Form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
React.createElement( | |
PasswordField, | |
null, | |
function (props) { | |
return React.createElement( | |
Field, | |
null, | |
props.label, | |
props.input | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const App = () => { | |
return ( | |
<PasswordField> | |
{(props) => ( | |
<Field> | |
{props.label} | |
{props.input} | |
</Field> | |
)} | |
</PasswordField> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const PasswordField = (props) => { | |
let children = { | |
label: <label>Password</label>, | |
input: <input type="password" /> | |
}; | |
if (props.children) { | |
return props.children(children); | |
} | |