sigil: turn padded into padding and take number

This commit is contained in:
Liam Fitzgerald 2021-02-09 12:24:28 +10:00
parent 91fbf81e74
commit a2cd566dd2
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB
7 changed files with 10 additions and 10 deletions

View File

@ -23,10 +23,10 @@ export const Sigil = memo(
size,
svgClass = '',
icon = false,
padded = false
padding = 0
}) => {
const padding = icon && padded ? '2px' : '0px';
const innerSize = icon && padded ? Number(size) - 4 : size;
const innerSize = Number(size) - 2*padding;
const paddingPx = `${padding}px`;
const foregroundColor = foreground
? foreground
: foregroundFromBackground(color);
@ -45,7 +45,7 @@ export const Sigil = memo(
borderRadius={icon ? '1' : '0'}
flexBasis={size}
backgroundColor={color}
padding={padding}
padding={paddingPx}
className={classes}
>
{sigil({

View File

@ -137,7 +137,7 @@ class ChatInput extends Component<ChatInputProps, ChatInputState> {
color={`#${color}`}
classes={sigilClass}
icon
padded
padding={2}
/>;
return (

View File

@ -279,7 +279,7 @@ export const MessageWithSigil = (props) => {
color={color}
classes={sigilClass}
icon
padded
padding={2}
/>
);

View File

@ -185,7 +185,7 @@ const GraphNode = ({
icon
color={`#000000`}
classes="mix-blend-diff"
padded
padding={2}
/>
) : <Box style={{ width: '16px' }}></Box>;

View File

@ -48,7 +48,7 @@ export default function Author(props: AuthorProps) {
width={16}
/>
) : (
<Sigil ship={ship} size={16} color={color} icon padded />
<Sigil ship={ship} size={16} color={color} icon padding={2} />
);
return (

View File

@ -51,7 +51,7 @@ export class OmniboxResult extends Component {
graphic = <Icon display="inline-block" verticalAlign="middle" icon='SignOut' mr='2' size='18px' color={iconFill} />;
} else if (icon === 'profile') {
text = text.startsWith('Profile') ? window.ship : text;
graphic = <Sigil color={color} classes='dib flex-shrink-0 v-mid mr2' ship={text} size={18} icon padded />;
graphic = <Sigil color={color} classes='dib flex-shrink-0 v-mid mr2' ship={text} size={18} icon padding={2} />;
} else if (icon === 'home') {
graphic = <Icon display='inline-block' verticalAlign='middle' icon='Home' mr='2' size='18px' color={iconFill} />;
} else if (icon === 'notifications') {

View File

@ -76,7 +76,7 @@ export function SidebarItem(props: {
if (props.contacts?.[title] && props.contacts[title].avatar) {
img = <BaseImage src={props.contacts[title].avatar} width='16px' height='16px' borderRadius={2}/>;
} else {
img = <Sigil ship={title} color={`#${uxToHex(props.contacts?.[title]?.color || '0x0')}`} icon padded size={16}/>
img = <Sigil ship={title} color={`#${uxToHex(props.contacts?.[title]?.color || '0x0')}`} icon padding={2} size={16}/>
}
if (props.contacts?.[title] && props.contacts[title].nickname) {
title = props.contacts[title].nickname;