mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
fix(core): tab icons
CB-150
This commit is contained in:
@@ -71,6 +71,7 @@
|
||||
padding-left: 12px;
|
||||
|
||||
StaticImage,
|
||||
IconOrImage,
|
||||
img {
|
||||
width: 22px;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ export type IconOrImageProps = {
|
||||
export const IconOrImage = function IconOrImage({ icon, className, viewBox }: IconOrImageProps) {
|
||||
|
||||
const isStaticIcon = useMemo(
|
||||
() => icon && icon.startsWith('platform:'),
|
||||
() => icon && (icon.startsWith('platform:') || icon.startsWith('/')),
|
||||
[icon]
|
||||
);
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import styled from 'reshadow';
|
||||
|
||||
import { useStyles } from '@dbeaver/core/theming';
|
||||
|
||||
import { StaticImage } from '../../StaticImage';
|
||||
import { IconOrImage } from '../../IconOrImage';
|
||||
|
||||
type TabIconProps = {
|
||||
icon?: string;
|
||||
@@ -20,7 +20,7 @@ type TabIconProps = {
|
||||
export function TabIcon({ icon, className }: TabIconProps) {
|
||||
return styled(useStyles())(
|
||||
<tab-icon as="div" className={className}>
|
||||
{icon ? <StaticImage icon={icon} /> : <placeholder as="div" />}
|
||||
{icon ? <IconOrImage icon={icon} /> : <placeholder as="div" />}
|
||||
</tab-icon>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user