// @flow import React, { useState } from 'react'; import compose from 'recompose/compose'; import type { GetCommunityType } from 'shared/graphql/queries/community/getCommunity'; import type { UserInfoType } from 'shared/graphql/fragments/user/userInfo'; import getCommunityThreads from 'shared/graphql/queries/community/getCommunityThreadConnection'; import ThreadFeed from 'src/components/threadFeed'; import Select from 'src/components/select'; import { withCurrentUser } from 'src/components/withCurrentUser'; import { PostsFeedsSelectorContainer } from '../style'; const CommunityThreadFeed = compose(getCommunityThreads)(ThreadFeed); type Props = { community: GetCommunityType, currentUser: ?UserInfoType, }; export const PostsFeeds = withCurrentUser((props: Props) => { const { community, currentUser } = props; const defaultFeed = !currentUser ? 'trending' : 'latest'; const [activeFeed, setActiveFeed] = useState(defaultFeed); return ( ); });