mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-19 17:52:45 +02:00
refactor: remove content grid no projects
This commit is contained in:
parent
aaf2dbb34a
commit
05906e607d
@ -1,114 +0,0 @@
|
|||||||
import { Typography, styled } from '@mui/material';
|
|
||||||
import { AvatarGroupFromOwners } from 'component/common/AvatarGroupFromOwners/AvatarGroupFromOwners';
|
|
||||||
import type { PersonalDashboardSchemaAdminsItem } from 'openapi/models/personalDashboardSchemaAdminsItem';
|
|
||||||
import type { PersonalDashboardSchemaProjectOwnersItem } from 'openapi/models/personalDashboardSchemaProjectOwnersItem';
|
|
||||||
import { Link } from 'react-router-dom';
|
|
||||||
import {
|
|
||||||
ContentGridContainer,
|
|
||||||
EmptyGridItem,
|
|
||||||
ProjectGrid,
|
|
||||||
GridItem,
|
|
||||||
} from './SharedComponents';
|
|
||||||
import { YourAdmins } from './YourAdmins';
|
|
||||||
|
|
||||||
const PaddedEmptyGridItem = styled(EmptyGridItem)(({ theme }) => ({
|
|
||||||
padding: theme.spacing(4),
|
|
||||||
}));
|
|
||||||
|
|
||||||
const TitleContainer = styled('div')(({ theme }) => ({
|
|
||||||
display: 'flex',
|
|
||||||
flexDirection: 'row',
|
|
||||||
gap: theme.spacing(2),
|
|
||||||
alignItems: 'center',
|
|
||||||
fontSize: theme.spacing(1.75),
|
|
||||||
fontWeight: 'bold',
|
|
||||||
}));
|
|
||||||
|
|
||||||
const NeutralCircleContainer = styled('span')(({ theme }) => ({
|
|
||||||
width: '28px',
|
|
||||||
height: '28px',
|
|
||||||
display: 'flex',
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
backgroundColor: theme.palette.neutral.border,
|
|
||||||
borderRadius: '50%',
|
|
||||||
}));
|
|
||||||
|
|
||||||
const GridContent = styled('div')(({ theme }) => ({
|
|
||||||
flexBasis: '50%',
|
|
||||||
padding: theme.spacing(4, 2),
|
|
||||||
display: 'flex',
|
|
||||||
gap: theme.spacing(3),
|
|
||||||
flexDirection: 'column',
|
|
||||||
}));
|
|
||||||
|
|
||||||
const BoxMainContent = styled('article')(({ theme }) => ({
|
|
||||||
display: 'flex',
|
|
||||||
flexFlow: 'column',
|
|
||||||
gap: theme.spacing(2),
|
|
||||||
}));
|
|
||||||
|
|
||||||
type Props = {
|
|
||||||
owners: PersonalDashboardSchemaProjectOwnersItem[];
|
|
||||||
admins: PersonalDashboardSchemaAdminsItem[];
|
|
||||||
};
|
|
||||||
|
|
||||||
export const ContentGridNoProjects: React.FC<Props> = ({ owners, admins }) => {
|
|
||||||
return (
|
|
||||||
<ContentGridContainer>
|
|
||||||
<ProjectGrid>
|
|
||||||
<GridItem gridArea='projects'>
|
|
||||||
<GridContent>
|
|
||||||
<Typography>
|
|
||||||
You don't currently have access to any projects in
|
|
||||||
the system.
|
|
||||||
</Typography>
|
|
||||||
<Typography>
|
|
||||||
To get started, you can{' '}
|
|
||||||
<Link to='/projects?create=true'>
|
|
||||||
create your own project
|
|
||||||
</Link>
|
|
||||||
. Alternatively, you can review the available
|
|
||||||
projects in the system and ask the owner for access.
|
|
||||||
</Typography>
|
|
||||||
</GridContent>
|
|
||||||
</GridItem>
|
|
||||||
<GridItem gridArea='box1'>
|
|
||||||
<GridContent>
|
|
||||||
<TitleContainer>
|
|
||||||
<NeutralCircleContainer>1</NeutralCircleContainer>
|
|
||||||
Contact Unleash admin
|
|
||||||
</TitleContainer>
|
|
||||||
<YourAdmins admins={admins} />
|
|
||||||
</GridContent>
|
|
||||||
</GridItem>
|
|
||||||
<GridItem gridArea='box2'>
|
|
||||||
<GridContent>
|
|
||||||
<TitleContainer>
|
|
||||||
<NeutralCircleContainer>2</NeutralCircleContainer>
|
|
||||||
Ask a project owner to add you to their project
|
|
||||||
</TitleContainer>
|
|
||||||
<BoxMainContent>
|
|
||||||
{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>
|
|
||||||
)}
|
|
||||||
</BoxMainContent>
|
|
||||||
</GridContent>
|
|
||||||
</GridItem>
|
|
||||||
<EmptyGridItem />
|
|
||||||
<PaddedEmptyGridItem gridArea='owners' />
|
|
||||||
</ProjectGrid>
|
|
||||||
</ContentGridContainer>
|
|
||||||
);
|
|
||||||
};
|
|
@ -13,7 +13,6 @@ import { usePersonalDashboard } from 'hooks/api/getters/usePersonalDashboard/use
|
|||||||
import { usePersonalDashboardProjectDetails } from 'hooks/api/getters/usePersonalDashboard/usePersonalDashboardProjectDetails';
|
import { usePersonalDashboardProjectDetails } from 'hooks/api/getters/usePersonalDashboard/usePersonalDashboardProjectDetails';
|
||||||
import useLoading from '../../hooks/useLoading';
|
import useLoading from '../../hooks/useLoading';
|
||||||
import { MyProjects } from './MyProjects';
|
import { MyProjects } from './MyProjects';
|
||||||
import { ContentGridNoProjects } from './ContentGridNoProjects';
|
|
||||||
import ExpandMore from '@mui/icons-material/ExpandMore';
|
import ExpandMore from '@mui/icons-material/ExpandMore';
|
||||||
import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
|
import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
|
||||||
import useSplashApi from 'hooks/api/actions/useSplashApi/useSplashApi';
|
import useSplashApi from 'hooks/api/actions/useSplashApi/useSplashApi';
|
||||||
|
Loading…
Reference in New Issue
Block a user