Download spectrum/src/views/community/containers/privateCommunity.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.3 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/src/views/community/containers/privateCommunity.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/src/views/community/containers/privateCommunity.js
-
curl -L -o privateCommunity.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/src/views/community/containers/privateCommunity.js
1.3 kB
| // @flow | |
| import React from 'react'; | |
| import type { GetCommunityType } from 'shared/graphql/queries/community/getCommunity'; | |
| import { Emoji, Heading, Description, PrivateCommunityWrapper } from '../style'; | |
| import { ViewGrid, CenteredGrid } from 'src/components/layout'; | |
| type Props = { | |
| community: GetCommunityType, | |
| }; | |
| export const PrivateCommunity = (props: Props) => { | |
| const { community } = props; | |
| const { communityPermissions } = community; | |
| const { isPending } = communityPermissions; | |
| const heading = isPending | |
| ? 'Your request to join is pending' | |
| : 'This community is private'; | |
| const description = isPending | |
| ? 'Your request to join this community is pending. The owners have been notified, and you will be notified if your request is approved.' | |
| : 'You can request to join this community below. The owners will be notified of your request, and you will be notified if your request is approved.'; | |
| return ( | |
| <ViewGrid data-cy="community-view-private"> | |
| <CenteredGrid> | |
| <PrivateCommunityWrapper> | |
| <Emoji role="img" aria-label="Private"> | |
| 🔑 | |
| </Emoji> | |
| <Heading>{heading}</Heading> | |
| <Description>{description}</Description> | |
| </PrivateCommunityWrapper> | |
| </CenteredGrid> | |
| </ViewGrid> | |
| ); | |
| }; | |