Jack Mallers
7 years ago
12 changed files with 273 additions and 27 deletions
@ -0,0 +1,25 @@ |
|||
import React, { Component } from 'react' |
|||
import PropTypes from 'prop-types' |
|||
import Isvg from 'react-inlinesvg' |
|||
import zapLogo from 'icons/zap_logo.svg' |
|||
import styles from './Alias.scss' |
|||
|
|||
const Alias = ({ alias, setAlias }) => { |
|||
console.log('alias: ', alias) |
|||
console.log('setAlias: ', setAlias) |
|||
|
|||
return ( |
|||
<div className={styles.container}> |
|||
<input |
|||
type='text' |
|||
placeholder='Satoshi' |
|||
className={styles.alias} |
|||
ref={input => input && input.focus()} |
|||
/> |
|||
</div> |
|||
) |
|||
} |
|||
|
|||
Alias.propTypes = {} |
|||
|
|||
export default Alias |
@ -0,0 +1,15 @@ |
|||
@import '../../variables.scss'; |
|||
|
|||
.alias { |
|||
background: transparent; |
|||
outline: none; |
|||
border: 0; |
|||
color: $gold; |
|||
-webkit-text-fill-color: $white; |
|||
font-size: 22px; |
|||
} |
|||
|
|||
.alias::-webkit-input-placeholder { |
|||
text-shadow: none; |
|||
-webkit-text-fill-color: initial; |
|||
} |
@ -0,0 +1,51 @@ |
|||
import React, { Component } from 'react' |
|||
import PropTypes from 'prop-types' |
|||
import Isvg from 'react-inlinesvg' |
|||
import zapLogo from 'icons/zap_logo.svg' |
|||
import styles from './FormContainer.scss' |
|||
|
|||
const FormContainer = ({ title, description, back, next, children }) => { |
|||
return ( |
|||
<div className={styles.container}> |
|||
<div className={styles.titleBar} /> |
|||
|
|||
<header className={styles.header}> |
|||
<section> |
|||
<Isvg src={zapLogo} /> |
|||
</section> |
|||
<section> |
|||
</section> |
|||
</header> |
|||
|
|||
<div className={styles.info}> |
|||
<h1>{title}</h1> |
|||
<p>{description}</p> |
|||
</div> |
|||
|
|||
<div className={styles.content}> |
|||
{children} |
|||
</div> |
|||
|
|||
<footer className={styles.footer}> |
|||
<div className={styles.buttonsContainer}> |
|||
<section> |
|||
{ |
|||
back && <div>Back</div> |
|||
} |
|||
</section> |
|||
<section> |
|||
{ |
|||
next && <div>Next</div> |
|||
} |
|||
</section> |
|||
</div> |
|||
</footer> |
|||
</div> |
|||
) |
|||
} |
|||
|
|||
FormContainer.propTypes = { |
|||
children: PropTypes.object.isRequired |
|||
} |
|||
|
|||
export default FormContainer |
@ -0,0 +1,67 @@ |
|||
@import '../../variables.scss'; |
|||
|
|||
.container { |
|||
position: relative; |
|||
height: 100vh; |
|||
background: $darkspaceblue; |
|||
} |
|||
|
|||
.titleBar { |
|||
background: $spacegrey; |
|||
height: 20px; |
|||
-webkit-user-select: none; |
|||
-webkit-app-region: drag; |
|||
} |
|||
|
|||
.header { |
|||
display: flex; |
|||
flex-direction: row; |
|||
justify-content: space-between; |
|||
padding: 20px 40px; |
|||
} |
|||
|
|||
.info { |
|||
color: $white; |
|||
margin: 20px 0 20px 0; |
|||
padding: 20px 40px; |
|||
|
|||
h1 { |
|||
font-size: 22px; |
|||
margin-bottom: 10px; |
|||
} |
|||
|
|||
p { |
|||
font-size: 12px; |
|||
} |
|||
} |
|||
|
|||
.content { |
|||
position: relative; |
|||
background: $spaceblue; |
|||
height: 100vh; |
|||
padding: 60px 40px; |
|||
} |
|||
|
|||
.footer { |
|||
position: absolute; |
|||
bottom: 0; |
|||
padding: 20px 40px; |
|||
color: $white; |
|||
width: calc(100% - 80px); |
|||
|
|||
.buttonsContainer { |
|||
display: flex; |
|||
flex-direction: row; |
|||
justify-content: space-between; |
|||
|
|||
div { |
|||
cursor: pointer; |
|||
transition: all 0.25s; |
|||
|
|||
&:hover { |
|||
opacity: 0.5; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
@ -0,0 +1,52 @@ |
|||
import React, { Component } from 'react' |
|||
import PropTypes from 'prop-types' |
|||
import Isvg from 'react-inlinesvg' |
|||
import zapLogo from 'icons/zap_logo.svg' |
|||
|
|||
import FormContainer from './FormContainer' |
|||
import Alias from './Alias' |
|||
import Syncing from './Syncing' |
|||
import styles from './Onboarding.scss' |
|||
|
|||
|
|||
class Onboarding extends Component { |
|||
render() { |
|||
const { |
|||
onboarding: { |
|||
step |
|||
}, |
|||
syncingProps |
|||
} = this.props |
|||
|
|||
const renderStep = () => { |
|||
console.log('step: ', step) |
|||
switch(step) { |
|||
case 1: |
|||
return ( |
|||
<FormContainer |
|||
title={'1. What should we call you?'} |
|||
description={'Set your nickname to help others connect with you on the Lightning Network'} |
|||
back={null} |
|||
next={() => console.log('alias next')} |
|||
> |
|||
<Alias /> |
|||
</FormContainer> |
|||
) |
|||
default: |
|||
return <Syncing {...syncingProps} /> |
|||
} |
|||
} |
|||
|
|||
return ( |
|||
<div className={styles.container}> |
|||
{renderStep()} |
|||
</div> |
|||
) |
|||
} |
|||
} |
|||
|
|||
Onboarding.propTypes = { |
|||
syncingProps: PropTypes.object.isRequired |
|||
} |
|||
|
|||
export default Onboarding |
@ -0,0 +1,3 @@ |
|||
import Onboarding from './Onboarding' |
|||
|
|||
export default Onboarding |
@ -0,0 +1,29 @@ |
|||
// ------------------------------------
|
|||
// Constants
|
|||
// ------------------------------------
|
|||
|
|||
|
|||
// ------------------------------------
|
|||
// Action Handlers
|
|||
// ------------------------------------
|
|||
const ACTION_HANDLERS = { |
|||
|
|||
} |
|||
|
|||
// ------------------------------------
|
|||
// Reducer
|
|||
// ------------------------------------
|
|||
const initialState = { |
|||
onboarded: false, |
|||
step: 1, |
|||
alias: '' |
|||
} |
|||
|
|||
// ------------------------------------
|
|||
// Reducer
|
|||
// ------------------------------------
|
|||
export default function lndReducer(state = initialState, action) { |
|||
const handler = ACTION_HANDLERS[action.type] |
|||
|
|||
return handler ? handler(state, action) : state |
|||
} |
Loading…
Reference in new issue