Commit 891b84e9 by Peter Holmberg Committed by GitHub

Fix: Tab icons not showing (#21465)

* revert back to i element

* snap
parent 30eef761
import React, { FC } from 'react';
import { cx } from 'emotion';
import { Icon } from '..';
import { useTheme } from '../../themes';
import { IconType } from '../Icon/types';
import { getTabsStyle } from './styles';
export interface TabProps {
label: string;
active?: boolean;
icon?: IconType;
icon?: string;
onChangeTab: () => void;
}
......@@ -18,7 +16,7 @@ export const Tab: FC<TabProps> = ({ label, active, icon, onChangeTab }) => {
return (
<li className={cx(tabsStyles.tabItem, active && tabsStyles.activeStyle)} onClick={onChangeTab}>
{icon && <Icon name={icon} />}
{icon && <i className={icon} />}
{label}
</li>
);
......
......@@ -26,7 +26,12 @@ const tabs = [
export const Simple = () => {
const VISUAL_GROUP = 'Visual options';
// ---
const icon = select('Icon', { None: undefined, Heart: 'heart', Star: 'star', User: 'user' }, undefined, VISUAL_GROUP);
const icon = select(
'Icon',
{ None: undefined, Heart: 'fa fa-heart', Star: 'fa fa-star', User: 'fa fa-user' },
undefined,
VISUAL_GROUP
);
return (
<UseState initialState={tabs}>
{(state, updateState) => {
......
......@@ -64,6 +64,7 @@ const Navigation = ({ main }: { main: NavModelItem }) => {
label={child.text}
active={child.active}
key={`${child.url}-${index}`}
icon={child.icon}
onChangeTab={() => goToUrl(index)}
/>
);
......
......@@ -100,6 +100,9 @@ exports[`ServerStats Should render table with stats 1`] = `
className="css-b418eg"
onClick={[Function]}
>
<i
className="icon"
/>
Admin
</li>
</ul>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment