Skip to content
Permalink
Browse files

fix(ui): hide suggested nodes channel when empty

resolve #1918
  • Loading branch information...
korhaliv committed Mar 31, 2019
1 parent 9ccc88c commit be9b57161a54f8e729542392e9d483cfebad3d3c
Showing with 26 additions and 22 deletions.
  1. +26 −22 renderer/components/Channels/NodeCardList.js
@@ -8,29 +8,33 @@ import messages from './messages'

const NodeCardList = ({ nodes, updateContactFormSearchQuery, ...rest }) => (
<Box as="article" {...rest}>
<Heading.h1 mb={3}>
<FormattedMessage {...messages.node_suggestions_title} />
</Heading.h1>
<Flex flexWrap="wrap">
{nodes.map((nodeInfo, index) => {
const column = index % 3
const isLeft = column === 0
const isMiddle = column === 1
const isRight = column === 2
{Boolean(nodes && nodes.length) && (
<>
<Heading.h1 mb={3}>
<FormattedMessage {...messages.node_suggestions_title} />
</Heading.h1>
<Flex flexWrap="wrap">
{nodes.map((nodeInfo, index) => {
const column = index % 3
const isLeft = column === 0
const isMiddle = column === 1
const isRight = column === 2

return (
<Flex
key={nodeInfo.pubkey}
pb={4}
pl={isLeft ? 0 : isMiddle ? 3 : 4}
pr={isRight ? 0 : isMiddle ? 3 : 4}
width={1 / 3}
>
<NodeCardView {...nodeInfo} nodeClicked={updateContactFormSearchQuery} width={1} />
</Flex>
)
})}
</Flex>
return (
<Flex
key={nodeInfo.pubkey}
pb={4}
pl={isLeft ? 0 : isMiddle ? 3 : 4}
pr={isRight ? 0 : isMiddle ? 3 : 4}
width={1 / 3}
>
<NodeCardView {...nodeInfo} nodeClicked={updateContactFormSearchQuery} width={1} />
</Flex>
)
})}
</Flex>
</>
)}
</Box>
)

0 comments on commit be9b571

Please sign in to comment.
You can’t perform that action at this time.