import React from 'react'; import I18n from 'coral-framework/modules/i18n/i18n'; import translations from 'coral-framework/translations'; const lang = new I18n(translations); import {TabBar, Tab, TabContent, Button} from 'coral-ui'; import Stream from '../containers/Stream'; import Count from 'coral-plugin-comment-count/CommentCount'; import UserBox from 'coral-sign-in/components/UserBox'; import ProfileContainer from 'coral-settings/containers/ProfileContainer'; import RestrictedContent from 'coral-framework/components/RestrictedContent'; import ConfigureStreamContainer from 'coral-configure/containers/ConfigureStreamContainer'; export default class Embed extends React.Component { changeTab = (tab) => { switch(tab) { case 0: this.props.setActiveTab('stream'); break; case 1: this.props.setActiveTab('profile'); // TODO: move data fetching to profile container. this.props.data.refetch(); break; case 2: this.props.setActiveTab('config'); // TODO: move data fetching to config container. this.props.data.refetch(); break; } } handleShowProfile = () => this.props.setActiveTab('profile'); render () { const {activeTab, logout, viewAllComments, commentId} = this.props; const {asset: {totalCommentCount}} = this.props.root; const {loggedIn, isAdmin, user} = this.props.auth; const userBox = ; return (
{lang.t('myProfile')} Configure Stream { commentId && } { loggedIn ? userBox : null } { loggedIn ? userBox : null }
); } } Embed.propTypes = { data: React.PropTypes.shape({ loading: React.PropTypes.bool, error: React.PropTypes.object }).isRequired, };