Download spectrum/src/components/threadFeed/nullState.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.14 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/spectrum/src/components/threadFeed/nullState.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/spectrum/src/components/threadFeed/nullState.js
-
curl -L -o nullState.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/spectrum/src/components/threadFeed/nullState.js
1.14 kB
| // @flow | |
| import * as React from 'react'; | |
| import Icon from 'src/components/icon'; | |
| import { NullColumn, NullColumnHeading, NullColumnSubheading } from './style'; | |
| type Props = { | |
| viewContext: | |
| | ?'communityInbox' | |
| | 'communityProfile' | |
| | 'channelInbox' | |
| | 'channelProfile' | |
| | 'userProfile', | |
| communityId: ?string, | |
| channelId: ?string, | |
| }; | |
| const NullState = ({ viewContext, communityId, channelId }: Props) => { | |
| let hd; | |
| let cp; | |
| if (viewContext && viewContext === 'communityProfile') { | |
| hd = 'There’s nothing in this community'; | |
| } | |
| if (viewContext && viewContext === 'channelProfile') { | |
| hd = 'There’s nothing in this channel'; | |
| } | |
| if (viewContext && viewContext === 'userProfile') { | |
| hd = 'This user hasn’t posted yet'; | |
| } | |
| const headingIcon = (communityId || channelId) && ( | |
| <Icon glyph={'post'} size={44} /> | |
| ); | |
| return ( | |
| <NullColumn> | |
| <span> | |
| {headingIcon && headingIcon} | |
| {hd && <NullColumnHeading>{hd}</NullColumnHeading>} | |
| {cp && <NullColumnSubheading>{cp}</NullColumnSubheading>} | |
| </span> | |
| </NullColumn> | |
| ); | |
| }; | |
| export default NullState; | |