diff --git a/web/community-header/community-header.css b/web/community-header/community-header.css new file mode 100644 --- /dev/null +++ b/web/community-header/community-header.css @@ -0,0 +1,22 @@ +.container { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 16px; + min-height: 32px; +} + +.header { + display: flex; + column-gap: 8px; + color: var(--text-background-primary-default); + font-size: var(--xl-font-20); + font-weight: var(--semi-bold); +} + +.communityButtonsContainer { + display: flex; + column-gap: 8px; + align-items: center; + justify-content: center; +} diff --git a/web/community-header/community-header.react.js b/web/community-header/community-header.react.js new file mode 100644 --- /dev/null +++ b/web/community-header/community-header.react.js @@ -0,0 +1,53 @@ +// @flow + +import * as React from 'react'; + +import { threadInfoSelector } from 'lib/selectors/thread-selectors.js'; +import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js'; + +import CommunityHeaderActions from './community-header-actions.react.js'; +import css from './community-header.css'; +import ThreadAvatar from '../avatars/thread-avatar.react.js'; +import { useSelector } from '../redux/redux-utils.js'; + +const COMMUNITY_SELECTED = true; +const COMMUNITY_SELECTED_ID = '256|84260'; +// const COMMUNITY_SELECTED_ID = '256|84145'; + +function CommunityHeader(): React.Node { + const selectedCommunity = useSelector( + state => threadInfoSelector(state)[COMMUNITY_SELECTED_ID], + ); + + const resolvedSelectedCommunity = useResolvedThreadInfo(selectedCommunity); + + const header = React.useMemo(() => { + if (!COMMUNITY_SELECTED) { + return