Browse Source

feature(SuggestedNodes): create suggested nodes component

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
c292984f17
  1. 62
      app/components/Contacts/Network.js
  2. 14
      app/components/Contacts/SuggestedNodes.js
  3. 0
      app/components/Contacts/SuggestedNodes.scss

62
app/components/Contacts/Network.js

@ -8,6 +8,7 @@ import plus from 'icons/plus.svg'
import search from 'icons/search.svg' import search from 'icons/search.svg'
import Value from 'components/Value' import Value from 'components/Value'
import SuggestedNodes from './SuggestedNodes'
import styles from './Network.scss' import styles from './Network.scss'
@ -139,6 +140,13 @@ class Network extends Component {
</header> </header>
<div className={styles.channels}> <div className={styles.channels}>
{
!loadingChannelPubkeys.length && !currentChannels.length &&
<SuggestedNodes />
}
{
loadingChannelPubkeys.length > 0 && currentChannels.length > 0 &&
<header className={styles.listHeader}> <header className={styles.listHeader}>
<section> <section>
<h2 onClick={toggleFilterPulldown} className={styles.filterTitle}> <h2 onClick={toggleFilterPulldown} className={styles.filterTitle}>
@ -154,22 +162,22 @@ class Network extends Component {
} }
</ul> </ul>
</section> </section>
<section className={styles.refreshContainer}>
<section className={styles.refreshContainer}> <span className={styles.refresh} onClick={refreshClicked} ref={(ref) => { this.repeat = ref }}>
<span className={styles.refresh} onClick={refreshClicked} ref={(ref) => { this.repeat = ref }}> {
{ this.state.refreshing ?
this.state.refreshing ? <FaRepeat />
<FaRepeat /> :
: 'Refresh'
'Refresh' }
} </span>
</span> </section>
</section>
</header> </header>
}
<ul className={filterPulldown && styles.fade}> <ul className={filterPulldown && styles.fade}>
{ {
loadingChannelPubkeys.map((loadingPubkey) => { loadingChannelPubkeys.length > 0 && loadingChannelPubkeys.map((loadingPubkey) => {
// TODO(jimmymow): refactor this out. same logic is in displayNodeName above // TODO(jimmymow): refactor this out. same logic is in displayNodeName above
const node = find(nodes, n => loadingPubkey === n.pub_key) const node = find(nodes, n => loadingPubkey === n.pub_key)
const nodeDisplay = () => { const nodeDisplay = () => {
@ -264,20 +272,22 @@ class Network extends Component {
} }
</ul> </ul>
</div> </div>
{
<footer className={styles.search}> loadingChannelPubkeys.length > 0 && currentChannels.length > 0 &&
<label htmlFor='search' className={`${styles.label} ${styles.input}`}> <footer className={styles.search}>
<Isvg src={search} /> <label htmlFor='search' className={`${styles.label} ${styles.input}`}>
</label> <Isvg src={search} />
<input </label>
id='search' <input
type='text' id='search'
className={`${styles.text} ${styles.input}`} type='text'
placeholder='search by alias or pubkey' className={`${styles.text} ${styles.input}`}
value={searchQuery} placeholder='search by alias or pubkey'
onChange={event => updateChannelSearchQuery(event.target.value)} value={searchQuery}
/> onChange={event => updateChannelSearchQuery(event.target.value)}
</footer> />
</footer>
}
</div> </div>
) )
} }

14
app/components/Contacts/SuggestedNodes.js

@ -0,0 +1,14 @@
import React from 'react'
import PropTypes from 'prop-types'
import styles from './SuggestedNodes.scss'
const SuggestedNodes = ({}) => {
console.log('yo')
return (
<div>suggested nodes</div>
)
}
SuggestedNodes.propTypes = {}
export default SuggestedNodes

0
app/components/Contacts/SuggestedNodes.scss

Loading…
Cancel
Save