1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-05 17:53:12 +02:00

feat: basic last modified by styling

This commit is contained in:
Thomas Heartman 2024-07-23 08:38:35 +02:00
parent 9315259589
commit 0fcc5b45ba
No known key found for this signature in database
GPG Key ID: BD1F880DAED1EE78

View File

@ -3,14 +3,46 @@ import { GroupCardAvatars } from 'component/admin/groups/GroupsList/GroupCard/Gr
import { UserAvatar } from 'component/common/UserAvatar/UserAvatar';
import type { IFeatureToggle } from 'interfaces/featureToggle';
import type { FC } from 'react';
import { Link } from 'react-router-dom';
type LastModifiedByProps = {
id: number;
name: string;
imageUrl: string;
};
const LastModifiedByContainer = styled('div')(({ theme }) => ({
display: 'grid',
gridTemplateAreas: `
'description description'
'avatar link'
`,
gap: theme.spacing(1),
alignItems: 'center',
height: 'min-content',
fontSize: theme.typography.body2.fontSize,
'.description': {
gridArea: 'description',
},
'.avatar': {
gridArea: 'avatar',
},
'.link': {
gridArea: 'link',
},
}));
const LastModifiedBy: FC<LastModifiedByProps> = ({ id, name, imageUrl }) => {
return <UserAvatar user={{ id, name, imageUrl }} />;
return (
<LastModifiedByContainer>
<span className='description'>Last modified by</span>
<UserAvatar className='avatar' user={{ id, name, imageUrl }} />
<Link className='link' to='logs'>
View change
</Link>
</LastModifiedByContainer>
);
};
type CollaboratorListProps = {
@ -24,6 +56,7 @@ const Container = styled('article')(({ theme }) => ({
display: 'flex',
flexDirection: 'row',
gap: theme.spacing(2),
alignItems: 'center',
}));
type Props = {