feat: style app connections

This commit is contained in:
Ali BARIN
2021-12-15 21:58:14 +01:00
parent fc85716d07
commit 78375934d7
17 changed files with 232 additions and 34 deletions

View File

@@ -1,5 +1,6 @@
import * as React from 'react';
import Avatar from '@mui/material/Avatar';
import type { AvatarProps } from '@mui/material/Avatar';
type AppIconProps = {
name: string;
@@ -11,18 +12,19 @@ const inlineImgStyle: React.CSSProperties = {
objectFit: 'contain',
};
export default function AppIcon(props: AppIconProps) {
const { name, url } = props;
export default function AppIcon(props: AppIconProps & AvatarProps) {
const { name, url, sx = {}, ...restProps } = props;
const color = url ? 'white' : props.color
return (
<Avatar
component="span"
variant="square"
sx={{ bgcolor: `#${color}` }}
sx={{ bgcolor: `#${color}`, display: 'inline-flex', width: 50, height: 50, ...sx }}
imgProps={{ style: inlineImgStyle }}
src={url}
alt={name}
{...restProps}
/>
);
};