-
-
Notifications
You must be signed in to change notification settings - Fork 730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: create page for when you have no projects #8285
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do this transformation in three different places now, so I thought it would be about time to break it out into a shared component.
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Manifest Files |
{noProjects ? ( | ||
<ContentGridNoProjects | ||
owners={[{ ownerType: 'system' }]} | ||
admins={[ | ||
{ name: 'admin' }, | ||
{ | ||
name: 'Christopher Tompkins', | ||
imageUrl: | ||
'https://avatars.githubusercontent.com/u/1010371?v=4', | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This entire bit is largely just wrapping the old content in a ternary. we'll probably sort this out with the union type down the road, but this makes it work right now.
@@ -106,7 +81,7 @@ export const ProjectOwners: FC<IProjectOwnersProps> = ({ owners = [] }) => { | |||
<StyledOwnerName> | |||
<StyledHeader data-loading>Owner</StyledHeader> | |||
<StyledUserName data-loading> | |||
{users[0]?.name} | |||
{getOwnerName(owners[0])} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if owners is an empty array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing happens as before; we show "system"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or rather: before, we wouldn't show anything (but theoretically it should never be empty). Now we show "system"
This adds a front end fallback screen for when you have no projects.