// @flow import React from 'react'; import { Link } from 'react-router-dom'; import { connect } from 'react-redux'; import compose from 'recompose/compose'; import { Loading } from 'src/components/loading'; import Icon from 'src/components/icon'; import viewNetworkHandler from 'src/components/viewNetworkHandler'; import ViewError from 'src/components/viewError'; import Tooltip from 'src/components/tooltip'; import getCommunityChannels from 'shared/graphql/queries/community/getCommunityChannelConnection'; import type { GetCommunityChannelConnectionType } from 'shared/graphql/queries/community/getCommunityChannelConnection'; import type { Dispatch } from 'redux'; import { ListContainer } from '../style'; import { SectionCard, SectionTitle } from 'src/components/settingsViews/style'; import { ChannelListItem } from 'src/components/listItems'; type Props = { data: { community: GetCommunityChannelConnectionType, }, isLoading: boolean, dispatch: Dispatch, communitySlug: string, }; class ChannelList extends React.Component { render() { const { data: { community }, isLoading, } = this.props; if (community) { const channels = community.channelConnection.edges.map(c => c && c.node); return ( Channels {channels.length > 0 && channels.map(channel => { if (!channel) return null; return ( ); })} ); } if (isLoading) { return ( ); } return ( ); } } export default compose( connect(), getCommunityChannels, viewNetworkHandler )(ChannelList);