Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x | import { styled, Typography } from "@mui/material";
import HtmlMeta from "components/HtmlMeta";
import EditCommunityPage from "features/communities/EditCommunityInfoPage";
import { useTranslation } from "i18n";
import { COMMUNITIES } from "i18n/namespaces";
import { CommunityTab } from "routes";
import { theme } from "theme";
import CommunityBase from "../CommunityBase";
import CommunityInfoPage from "../CommunityInfoPage";
import { DiscussionsListPage, DiscussionsSection } from "../discussions";
import CommunityEventsList from "../events/CommunityEventsList";
import EventsSection from "../events/EventsSection";
import CommunityMembersList from "../members/CommunityMembersList";
import PageHeader from "../PageHeader";
import CommunityPageSubHeader from "./CommunityPageSubHeader";
import InfoPageSection from "./InfoPageSection";
const StyledTitle = styled(Typography)(() => ({
marginTop: theme.spacing(3),
}));
export default function CommunityPage({
communityId,
tab = "overview",
edit = false,
}: {
communityId: number;
tab: CommunityTab | undefined;
edit: boolean | undefined;
}) {
const { t } = useTranslation([COMMUNITIES]);
return (
<CommunityBase communityId={communityId}>
{({ community }) => {
return (
<>
<HtmlMeta title={community.name} />
{community.mainPage && <PageHeader page={community.mainPage} />}
<CommunityPageSubHeader community={community} tab={tab} />
{tab === "overview" ? (
<>
<StyledTitle variant="h1">
{t("communities:community_header", { name: community.name })}
</StyledTitle>
<InfoPageSection community={community} />
{community.eventsEnabled && (
<EventsSection community={community} />
)}
{community.discussionsEnabled && (
<DiscussionsSection community={community} />
)}
</>
) : tab === "info" ? (
edit ? (
<EditCommunityPage communityId={community.communityId} />
) : (
<CommunityInfoPage community={community} />
)
) : tab === "discussions" ? (
<DiscussionsListPage community={community} />
) : tab === "events" ? (
<CommunityEventsList community={community} />
) : tab === "members" ? (
<CommunityMembersList
communityId={community.communityId}
memberCount={community.memberCount}
/>
) : null}
</>
);
}}
</CommunityBase>
);
}
|