mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 16:51:42 +03:00
sigil: turn padded into padding and take number
This commit is contained in:
parent
91fbf81e74
commit
a2cd566dd2
@ -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({
|
||||
|
@ -137,7 +137,7 @@ class ChatInput extends Component<ChatInputProps, ChatInputState> {
|
||||
color={`#${color}`}
|
||||
classes={sigilClass}
|
||||
icon
|
||||
padded
|
||||
padding={2}
|
||||
/>;
|
||||
|
||||
return (
|
||||
|
@ -279,7 +279,7 @@ export const MessageWithSigil = (props) => {
|
||||
color={color}
|
||||
classes={sigilClass}
|
||||
icon
|
||||
padded
|
||||
padding={2}
|
||||
/>
|
||||
);
|
||||
|
||||
|
@ -185,7 +185,7 @@ const GraphNode = ({
|
||||
icon
|
||||
color={`#000000`}
|
||||
classes="mix-blend-diff"
|
||||
padded
|
||||
padding={2}
|
||||
/>
|
||||
) : <Box style={{ width: '16px' }}></Box>;
|
||||
|
||||
|
@ -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 (
|
||||
|
@ -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') {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user