Download spectrum/src/components/githubProfile/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 826 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/spectrum/src/components/githubProfile/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/spectrum/src/components/githubProfile/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/spectrum/src/components/githubProfile/index.js
826 Bytes
| // @flow | |
| import * as React from 'react'; | |
| import compose from 'recompose/compose'; | |
| import viewNetworkHandler, { | |
| type ViewNetworkHandlerType, | |
| } from '../viewNetworkHandler'; | |
| import getUserGithubProfile, { | |
| type GetUserGithbProfileType, | |
| } from 'shared/graphql/queries/user/getUserGithubProfile'; | |
| type Props = { | |
| id: string, | |
| ...$Exact<ViewNetworkHandlerType>, | |
| data: { | |
| user?: GetUserGithbProfileType, | |
| }, | |
| render: Function, | |
| }; | |
| class GithubProfile extends React.Component<Props> { | |
| render() { | |
| const { | |
| data: { user }, | |
| render, | |
| } = this.props; | |
| if (user) { | |
| if (!user.githubProfile || !user.githubProfile.id) return render(null); | |
| return render(user.githubProfile); | |
| } | |
| return null; | |
| } | |
| } | |
| export default compose( | |
| getUserGithubProfile, | |
| viewNetworkHandler | |
| )(GithubProfile); | |