(props: Props)
| 8 | } |
| 9 | |
| 10 | export default function SelectedRepo(props: Props) { |
| 11 | const viewer = useFragment( |
| 12 | graphql` |
| 13 | fragment SelectedRepo_viewer on User { |
| 14 | selectedRepo { |
| 15 | displayColor |
| 16 | fullName |
| 17 | isPrivate |
| 18 | } |
| 19 | } |
| 20 | `, |
| 21 | props.viewer, |
| 22 | ) |
| 23 | |
| 24 | const repo = viewer.selectedRepo |
| 25 | if (!repo || !repo.isPrivate) return null |
| 26 | const backgroundColor = repo.displayColor as string |
| 27 | |
| 28 | return ( |
| 29 | <div className="SelectedRepo-banner" style={{ backgroundColor }}> |
| 30 | <h2>{repo.fullName || 'Personal repo'}</h2> |
| 31 | </div> |
| 32 | ) |
| 33 | } |
nothing calls this directly
no outgoing calls
no test coverage detected