spee.ch/react/components/ShowChannel/view.jsx

42 lines
1.5 KiB
React
Raw Normal View History

import React from 'react';
2018-02-23 20:00:46 +01:00
import SEO from 'components/SEO';
import ErrorPage from 'components/ErrorPage';
import NavBar from 'containers/NavBar';
2018-02-03 03:16:18 +01:00
import ChannelClaimsDisplay from 'containers/ChannelClaimsDisplay';
2018-02-23 20:00:46 +01:00
import { createPageTitle } from 'utils/pageTitle';
import { createChannelCanonicalLink } from 'utils/canonicalLink';
import { createChannelMetaTags } from 'utils/metaTags';
class ShowChannel extends React.Component {
render () {
const { channel } = this.props;
2018-02-09 01:42:13 +01:00
if (channel) {
const { name, longId, shortId } = channel;
2018-02-23 20:00:46 +01:00
const pageTitle = createPageTitle(`${name}`);
const canonicalLink = createChannelCanonicalLink(channel);
const metaTags = createChannelMetaTags(channel);
2018-02-09 01:42:13 +01:00
return (
<div>
2018-02-23 20:00:46 +01:00
<SEO pageTitle={pageTitle} canonicalLink={canonicalLink} metaTags={metaTags} />
<NavBar />
<div className='row row--tall row--padded'>
<div className='column column--10'>
<h2>channel name: {name || 'loading...'}</h2>
<p className={'fine-print'}>full channel id: {longId || 'loading...'}</p>
<p className={'fine-print'}>short channel id: {shortId || 'loading...'}</p>
2018-02-09 01:42:13 +01:00
</div>
<div className='column column--10'>
<ChannelClaimsDisplay />
2018-02-09 01:42:13 +01:00
</div>
</div>
</div>
2018-02-09 01:42:13 +01:00
);
};
return (
<ErrorPage error={'loading channel data...'} />
);
}
};
export default ShowChannel;