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:
parent
9315259589
commit
0fcc5b45ba
@ -3,14 +3,46 @@ import { GroupCardAvatars } from 'component/admin/groups/GroupsList/GroupCard/Gr
|
|||||||
import { UserAvatar } from 'component/common/UserAvatar/UserAvatar';
|
import { UserAvatar } from 'component/common/UserAvatar/UserAvatar';
|
||||||
import type { IFeatureToggle } from 'interfaces/featureToggle';
|
import type { IFeatureToggle } from 'interfaces/featureToggle';
|
||||||
import type { FC } from 'react';
|
import type { FC } from 'react';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
type LastModifiedByProps = {
|
type LastModifiedByProps = {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
imageUrl: 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 }) => {
|
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 = {
|
type CollaboratorListProps = {
|
||||||
@ -24,6 +56,7 @@ const Container = styled('article')(({ theme }) => ({
|
|||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
gap: theme.spacing(2),
|
gap: theme.spacing(2),
|
||||||
|
alignItems: 'center',
|
||||||
}));
|
}));
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
Loading…
Reference in New Issue
Block a user