diff --git a/pkg/interface/src/logic/lib/sigil.js b/pkg/interface/src/logic/lib/sigil.js index a455307b9a..6e606be904 100644 --- a/pkg/interface/src/logic/lib/sigil.js +++ b/pkg/interface/src/logic/lib/sigil.js @@ -1,5 +1,6 @@ import React, { memo } from 'react'; import { sigil, reactRenderer } from '@tlon/sigil-js'; +import { Box } from '@tlon/indigo-react'; export const foregroundFromBackground = (background) => { const rgb = { @@ -11,30 +12,42 @@ export const foregroundFromBackground = (background) => { const whiteBrightness = 255; return ((whiteBrightness - brightness) < 50) ? 'black' : 'white'; -} +}; -export const Sigil = memo(({ classes = '', color, ship, size, svgClass = '', icon = false }) => { +export const Sigil = memo(({ classes = '', color, foreground = '', ship, size, svgClass = '', icon = false, padded = false }) => { + const padding = (icon && padded) ? '2px' : '0px'; + const innerSize = (icon && padded) ? (Number(size) - 4) : size; + const foregroundColor = foreground ? foreground : foregroundFromBackground(color); return ship.length > 14 - ? (
-
) - : (
+ ? () : ( + {sigil({ patp: ship, renderer: reactRenderer, - size: size, + size: innerSize, icon, colors: [ color, - foregroundFromBackground(color) + foregroundColor ], class: svgClass })} -
) -}) + ); +}); + +Sigil.displayName = 'Sigil'; export default Sigil; diff --git a/pkg/interface/src/views/apps/chat/components/ChatInput.tsx b/pkg/interface/src/views/apps/chat/components/ChatInput.tsx index 4149457c97..ed348fbafb 100644 --- a/pkg/interface/src/views/apps/chat/components/ChatInput.tsx +++ b/pkg/interface/src/views/apps/chat/components/ChatInput.tsx @@ -185,6 +185,7 @@ export default class ChatInput extends Component size={16} color={`#${color}`} classes={sigilClass} + icon />; return ( @@ -197,6 +198,7 @@ export default class ChatInput extends Component borderTopColor='washedGray' backgroundColor='white' className='cf' + zIndex='0' >
{avatar} diff --git a/pkg/interface/src/views/apps/chat/components/overlay-sigil.js b/pkg/interface/src/views/apps/chat/components/overlay-sigil.js index 83018791dd..25ede220f1 100644 --- a/pkg/interface/src/views/apps/chat/components/overlay-sigil.js +++ b/pkg/interface/src/views/apps/chat/components/overlay-sigil.js @@ -64,6 +64,8 @@ export class OverlaySigil extends PureComponent { size={16} color={props.color} classes={props.sigilClass} + icon + padded />; return ( diff --git a/pkg/interface/src/views/components/StatusBar.js b/pkg/interface/src/views/components/StatusBar.js index fc0dda2b6e..eb21260b24 100644 --- a/pkg/interface/src/views/components/StatusBar.js +++ b/pkg/interface/src/views/components/StatusBar.js @@ -40,7 +40,7 @@ const StatusBar = (props) => { props.history.push('/~profile')}> - + ~{props.ship} diff --git a/pkg/interface/src/views/components/leap/OmniboxResult.js b/pkg/interface/src/views/components/leap/OmniboxResult.js index 3f92a31152..6bc2079b72 100644 --- a/pkg/interface/src/views/components/leap/OmniboxResult.js +++ b/pkg/interface/src/views/components/leap/OmniboxResult.js @@ -36,7 +36,7 @@ export class OmniboxResult extends Component { } else if (icon === 'logout') { graphic = ; } else if (icon === 'profile') { - graphic = ; + graphic = ; } else if (icon === 'home') { graphic = ; } else {