File size: 825 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
// @flow
import * as React from 'react';
import type { GetThreadType } from 'shared/graphql/queries/thread/getThread';
import ThreadHeader from './threadHeader';
import UserProfileThreadHeader from './userProfileThreadHeader';
export type HeaderProps = {
thread: GetThreadType,
active: boolean,
currentUser: ?Object,
viewContext?:
| ?'inbox'
| 'communityInbox'
| 'communityProfile'
| 'channelInbox'
| 'channelProfile'
| 'userProfile'
| 'userProfileReplies',
};
class Header extends React.Component<HeaderProps> {
render() {
if (
this.props.viewContext === 'userProfile' ||
this.props.viewContext === 'userProfileReplies'
) {
return <UserProfileThreadHeader {...this.props} />;
}
return <ThreadHeader {...this.props} />;
}
}
export default Header;
|