Last active
January 1, 2018 16:01
-
-
Save nicohvi/bb2f7a7016f919dd35a16868a37c04e1 to your computer and use it in GitHub Desktop.
This file contains 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
<div | |
onKeyDown={R.compose( | |
() => api.template(templates), | |
enter => { | |
if (enter) api.language('nn'); | |
}, | |
isEnter | |
)} | |
/> |
This file contains 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 * as R from 'ramda'; | |
import * as $ from 'baquery'; | |
import * as React from 'react'; | |
import { iOS } from '../../lib'; | |
import { Spinner } from '../../components'; | |
import api from './api'; | |
import { | |
Form, | |
ForgottenPassword, | |
MFA, | |
MFASetup, | |
MFAFinalize, | |
Done | |
} from './components'; | |
const App = props => { | |
if (props.step === 'hide') return null; | |
const step = R.cond([ | |
[R.equals('inputs'), () => <Form {...props} />], | |
[R.equals('password'), () => <ForgottenPassword {...props} />], | |
[R.equals('mfa-setup'), () => <MFASetup {...props} />], | |
[R.equals('mfa-final'), () => <MFAFinalize {...props} />], | |
[R.equals('mfa'), () => <MFA {...props} />], | |
[R.equals('done'), () => <Done {...props} />], | |
[R.equals('loading'), () => <Spinner />] | |
])(props.step); | |
return ( | |
<div className="modal-container"> | |
<div className="modal"> | |
{step} | |
<i | |
className="icon icon-close click" | |
onClick={R.compose(() => { | |
if (iOS()) $('body').removeClass('ios-fix'); | |
}, api.reset)} | |
/> | |
</div> | |
</div> | |
); | |
}; | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment