chore: fix vault badge styling

This commit is contained in:
Aman Harwara
2023-08-08 22:26:52 +05:30
parent 02dda6d0fe
commit 9b66c2f9f7
3 changed files with 21 additions and 9 deletions

View File

@@ -4,11 +4,14 @@ import { IconNameToSvgMapping } from './IconNameToSvgMapping'
import { classNames } from '@standardnotes/utils'
import { LexicalIconName, LexicalIconNameToSvgMapping } from './LexicalIcons'
type Size = 'small' | 'medium' | 'normal' | 'large' | 'custom'
type Props = {
type: VectorIconNameOrEmoji | LexicalIconName
className?: string
ariaLabel?: string
size?: 'small' | 'medium' | 'normal' | 'large' | 'custom'
size?: Size
emojiSize?: Size
}
const ContainerDimensions = {
@@ -54,7 +57,7 @@ export const isIconEmoji = (type: VectorIconNameOrEmoji): boolean => {
return getIconComponent(type) == undefined
}
const Icon: FunctionComponent<Props> = ({ type, className = '', ariaLabel, size = 'normal' }) => {
const Icon: FunctionComponent<Props> = ({ type, className = '', ariaLabel, size = 'normal', emojiSize }) => {
const IconComponent = getIconComponent(type)
if (!IconComponent) {
return (
@@ -62,9 +65,9 @@ const Icon: FunctionComponent<Props> = ({ type, className = '', ariaLabel, size
className={classNames(
'fill-current',
'text-center',
EmojiSize[size],
EmojiContainerDimensions[size],
EmojiOffset[size],
EmojiSize[emojiSize || size],
EmojiContainerDimensions[emojiSize || size],
EmojiOffset[emojiSize || size],
className,
)}
>