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