Jack Mallers
7 years ago
14 changed files with 499 additions and 96 deletions
@ -0,0 +1,42 @@ |
|||
import React from 'react' |
|||
import PropTypes from 'prop-types' |
|||
|
|||
import Isvg from 'react-inlinesvg' |
|||
import x from 'icons/x.svg' |
|||
|
|||
import ConnectManually from './ConnectManually' |
|||
import SubmitChannelForm from './SubmitChannelForm' |
|||
|
|||
import styles from './ChannelForm.scss' |
|||
|
|||
const FORM_TYPES = { |
|||
MANUAL_FORM: ConnectManually, |
|||
SUBMIT_CHANNEL_FORM: SubmitChannelForm |
|||
} |
|||
|
|||
const ChannelForm = ({ formType, formProps, closeForm }) => { |
|||
console.log('formType: ', formType) |
|||
if (!formType) { return null } |
|||
|
|||
const FormComponent = FORM_TYPES[formType] |
|||
console.log('FormComponent: ', FormComponent) |
|||
return ( |
|||
<div className={styles.container}> |
|||
<div className={styles.closeContainer}> |
|||
<span onClick={closeForm}> |
|||
<Isvg src={x} /> |
|||
</span> |
|||
</div> |
|||
<FormComponent {...formProps} /> |
|||
</div> |
|||
) |
|||
} |
|||
|
|||
|
|||
ChannelForm.propTypes = { |
|||
formType: PropTypes.string, |
|||
formProps: PropTypes.object.isRequired, |
|||
closeForm: PropTypes.func.isRequired |
|||
} |
|||
|
|||
export default ChannelForm |
@ -0,0 +1,29 @@ |
|||
@import '../../variables.scss'; |
|||
|
|||
.container { |
|||
position: absolute; |
|||
top: 0; |
|||
z-index: 10; |
|||
height: 100vh; |
|||
width: 100%; |
|||
background: #31343F; |
|||
} |
|||
|
|||
.closeContainer { |
|||
text-align: right; |
|||
padding: 20px 40px 0px; |
|||
|
|||
span { |
|||
cursor: pointer; |
|||
opacity: 1.0; |
|||
transition: 0.25s all; |
|||
|
|||
&:hover { |
|||
opacity: 0.5; |
|||
} |
|||
} |
|||
|
|||
svg { |
|||
color: $white; |
|||
} |
|||
} |
@ -0,0 +1,46 @@ |
|||
import React from 'react' |
|||
import PropTypes from 'prop-types' |
|||
|
|||
import { FaAngleDown } from 'react-icons/lib/fa' |
|||
import Isvg from 'react-inlinesvg' |
|||
import x from 'icons/x.svg' |
|||
|
|||
import styles from './ConnectManually.scss' |
|||
|
|||
class ConnectManually extends React.Component { |
|||
render() { |
|||
const { |
|||
manualFormOpen, |
|||
manualSearchQuery, |
|||
|
|||
closeManualForm, |
|||
updateManualFormSearchQuery |
|||
} = this.props |
|||
|
|||
console.log('props: ', this.props) |
|||
|
|||
return ( |
|||
<div className={styles.content}> |
|||
<header className={styles.header}> |
|||
<h1>Connect Manually</h1> |
|||
<p>Please enter the peer's pubkey@host</p> |
|||
</header> |
|||
|
|||
<section className={styles.peer}> |
|||
<div className={styles.input}> |
|||
<input |
|||
type='text' |
|||
placeholder='pubkey@host' |
|||
value={manualSearchQuery} |
|||
onChange={event => updateManualFormSearchQuery(event.target.value)} |
|||
/> |
|||
</div> |
|||
</section> |
|||
</div> |
|||
) |
|||
} |
|||
} |
|||
|
|||
ConnectManually.propTypes = {} |
|||
|
|||
export default ConnectManually |
@ -0,0 +1,102 @@ |
|||
@import '../../variables.scss'; |
|||
|
|||
.container { |
|||
position: absolute; |
|||
top: 0; |
|||
z-index: 10; |
|||
height: 100vh; |
|||
width: 100%; |
|||
background: #31343F; |
|||
} |
|||
|
|||
.closeContainer { |
|||
text-align: right; |
|||
padding: 20px 40px 0px; |
|||
|
|||
span { |
|||
cursor: pointer; |
|||
opacity: 1.0; |
|||
transition: 0.25s all; |
|||
|
|||
&:hover { |
|||
opacity: 0.5; |
|||
} |
|||
} |
|||
|
|||
svg { |
|||
color: $white; |
|||
} |
|||
} |
|||
|
|||
|
|||
.content { |
|||
padding: 0 40px; |
|||
font-family: Roboto; |
|||
color: $white; |
|||
|
|||
.header { |
|||
padding: 20px 100px; |
|||
|
|||
h1 { |
|||
margin-bottom: 15px; |
|||
font-size: 20px; |
|||
} |
|||
|
|||
p { |
|||
text-align: center; |
|||
line-height: 1.3; |
|||
font-size: 14px; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.header { |
|||
text-align: center; |
|||
padding-bottom: 20px; |
|||
border-bottom: 1px solid $spaceborder; |
|||
|
|||
h1 { |
|||
font-size: 22px; |
|||
font-weight: 100; |
|||
margin-top: 10px; |
|||
letter-spacing: 1.5px; |
|||
} |
|||
} |
|||
|
|||
.title { |
|||
margin: 50px 0; |
|||
|
|||
h2 { |
|||
font-size: 14px; |
|||
background: $spaceblue; |
|||
padding: 10px; |
|||
border-radius: 17.5px; |
|||
display: inline; |
|||
} |
|||
} |
|||
|
|||
.input { |
|||
display: flex; |
|||
flex-direction: row; |
|||
align-items: center; |
|||
margin-top: 50px; |
|||
|
|||
input { |
|||
font-size: 25px; |
|||
} |
|||
} |
|||
|
|||
.input input { |
|||
background: transparent; |
|||
outline: none; |
|||
border: 0; |
|||
color: $gold; |
|||
-webkit-text-fill-color: $white; |
|||
width: 100%; |
|||
font-weight: 200; |
|||
} |
|||
|
|||
.input input::-webkit-input-placeholder, ::-webkit-input-placeholder { |
|||
text-shadow: none; |
|||
-webkit-text-fill-color: initial; |
|||
} |
Loading…
Reference in new issue