-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #156 from github-community-projects/sutterj/org-se…
…lection feat: add org selection page
- Loading branch information
Showing
16 changed files
with
415 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,9 @@ | ||
'use client' | ||
|
||
import { Box } from '@primer/react' | ||
import { OrgHeader } from 'app/components/header/OrgHeader' | ||
import { useOrgData } from 'hooks/useOrganization' | ||
|
||
const DashLayout = ({ children }: { children: React.ReactNode }) => { | ||
const orgData = useOrgData() | ||
|
||
return ( | ||
<Box sx={{ margin: '10px 90px' }}> | ||
<Box> | ||
<OrgHeader orgData={orgData} /> | ||
</Box> | ||
<Box>{children}</Box> | ||
</Box> | ||
) | ||
return <Box>{children}</Box> | ||
} | ||
|
||
export default DashLayout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Box, Breadcrumbs } from '@primer/react' | ||
import { OrgData } from 'hooks/useOrganization' | ||
|
||
interface ForkBreadcrumbsProps { | ||
orgData: OrgData | ||
} | ||
|
||
export const OrgBreadcrumbs = ({ orgData }: ForkBreadcrumbsProps) => { | ||
if (!orgData) { | ||
return null | ||
} | ||
|
||
return ( | ||
<Box sx={{ marginBottom: '10px' }}> | ||
<Breadcrumbs sx={{ display: 'inline-block', paddingRight: '10px' }}> | ||
<Breadcrumbs.Item href="/" sx={{ fontSize: '2', fontWeight: 'bold' }}> | ||
All organizations | ||
</Breadcrumbs.Item> | ||
<Breadcrumbs.Item selected sx={{ fontSize: '2', fontWeight: 'bold' }}> | ||
{orgData?.login} | ||
</Breadcrumbs.Item> | ||
</Breadcrumbs> | ||
</Box> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { Avatar, Label, Link, Pagehead, Spinner, Text } from '@primer/react' | ||
import { Stack } from '@primer/react/lib-esm/Stack' | ||
import { ForkData } from 'hooks/useFork' | ||
|
||
interface ForkHeaderProps { | ||
forkData: ForkData | ||
} | ||
|
||
export const ForkHeader = ({ forkData }: ForkHeaderProps) => { | ||
return ( | ||
<Pagehead> | ||
{forkData ? ( | ||
<Stack direction="horizontal" align="center"> | ||
<Stack.Item> | ||
<Avatar | ||
src={ | ||
forkData.parent?.owner.avatar_url ?? forkData.owner.avatar_url | ||
} | ||
size={48} | ||
/> | ||
</Stack.Item> | ||
<Stack.Item grow={false}> | ||
<Stack.Item> | ||
<Link | ||
href={forkData.html_url} | ||
target="_blank" | ||
rel="noreferrer noopener" | ||
sx={{ | ||
color: 'fg.default', | ||
fontSize: '3', | ||
fontWeight: 'bold', | ||
paddingRight: '5px', | ||
}} | ||
> | ||
{forkData.organization?.login}/{forkData.name} | ||
</Link> | ||
<Label variant="secondary"> | ||
{forkData.private ? 'Private' : 'Public'} | ||
</Label> | ||
</Stack.Item> | ||
<Stack.Item> | ||
<Text sx={{ color: 'fg.muted' }}> | ||
Forked from{' '} | ||
<Link | ||
href={`https://github.com/${forkData.parent?.owner.login}/${forkData.parent?.name}`} | ||
target="_blank" | ||
rel="noreferrer noopener" | ||
sx={{ color: 'fg.muted' }} | ||
> | ||
{forkData.parent?.owner.login}/{forkData.parent?.name} | ||
</Link> | ||
</Text> | ||
</Stack.Item> | ||
</Stack.Item> | ||
</Stack> | ||
) : ( | ||
<Stack align="center" direction="horizontal"> | ||
<Stack.Item> | ||
<Spinner sx={{ marginTop: '5px' }} /> | ||
</Stack.Item> | ||
<Stack.Item> | ||
<Text | ||
sx={{ color: 'fg.default', fontSize: '3', fontWeight: 'bold' }} | ||
> | ||
Loading fork data... | ||
</Text> | ||
</Stack.Item> | ||
</Stack> | ||
)} | ||
</Pagehead> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { BugIcon, GitBranchIcon, RepoForkedIcon } from '@primer/octicons-react' | ||
import { Avatar, Octicon, Pagehead, Text } from '@primer/react' | ||
import { Stack } from '@primer/react/lib-esm/Stack' | ||
|
||
export const WelcomeHeader = () => { | ||
return ( | ||
<Pagehead> | ||
<Stack align="center" direction="horizontal"> | ||
<Stack.Item> | ||
<Octicon icon={RepoForkedIcon} size={48} /> | ||
</Stack.Item> | ||
<Stack.Item> | ||
<Text sx={{ color: 'fg.default', fontSize: '3', fontWeight: 'bold' }}> | ||
Welcome to Internal Contribution Forks! | ||
</Text> | ||
</Stack.Item> | ||
</Stack> | ||
</Pagehead> | ||
) | ||
} |
Oops, something went wrong.