mirror of
https://github.com/Unleash/unleash.git
synced 2025-11-24 20:06:55 +01:00
This PR continues the refactoring of the front end code for dashboards. The main points are: - Extracts the `ActionBox` component that we used in a lot of places. There were some minor differences between the various incarnations, so this also better aligns them. - Extract other components (`AskOwnerToAddYouToTheirProject`, `YourAdmins`) - Move the `NeutralCircleContainer` into `SharedComponents` - Delete the separate no content grid (this is now handled in projects instead) - extract my projects grid contents into a single function so that it's easier to understand what content you get for what states Here's all the states side by side: 
30 lines
1.0 KiB
TypeScript
30 lines
1.0 KiB
TypeScript
import { ActionBox } from './ActionBox';
|
|
import { NeutralCircleContainer } from './SharedComponents';
|
|
import type { PersonalDashboardSchemaProjectOwnersItem } from 'openapi';
|
|
import type { FC } from 'react';
|
|
import { AvatarGroupFromOwners } from 'component/common/AvatarGroupFromOwners/AvatarGroupFromOwners';
|
|
|
|
export const AskOwnerToAddYouToTheirProject: FC<{
|
|
owners: PersonalDashboardSchemaProjectOwnersItem[];
|
|
}> = ({ owners }) => {
|
|
return (
|
|
<ActionBox
|
|
title={
|
|
<>
|
|
<NeutralCircleContainer>2</NeutralCircleContainer>
|
|
Ask a project owner to add you to their project
|
|
</>
|
|
}
|
|
>
|
|
{owners.length ? (
|
|
<>
|
|
<p>Project owners in Unleash:</p>
|
|
<AvatarGroupFromOwners users={owners} avatarLimit={9} />
|
|
</>
|
|
) : (
|
|
<p>There are no project owners in Unleash to ask for access.</p>
|
|
)}
|
|
</ActionBox>
|
|
);
|
|
};
|