1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-10 01:16:39 +02:00

fix: adjust tooltip for toggle type

This commit is contained in:
Ivar Conradi Østhus 2021-10-21 10:41:46 +02:00
parent fea7707551
commit 0ddd52a8ba
2 changed files with 9 additions and 3 deletions

View File

@ -51,7 +51,7 @@ exports[`renders correctly with one feature 1`] = `
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title={null}
title="This is a \\"\\" toggle"
viewBox="0 0 24 24"
>
<path
@ -186,7 +186,7 @@ exports[`renders correctly with one feature without permission 1`] = `
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title={null}
title="This is a \\"\\" toggle"
viewBox="0 0 24 24"
>
<path

View File

@ -1,6 +1,7 @@
import { useStyles } from './FeatureType.styles';
import { Tooltip } from '@material-ui/core';
import { getFeatureTypeIcons } from '../../../../utils/get-feature-type-icons';
import useFeatureTypes from '../../../../hooks/api/getters/useFeatureTypes/useFeatureTypes';
interface FeatureTypeProps {
@ -9,10 +10,15 @@ interface FeatureTypeProps {
const FeatureStatus = ({ type }: FeatureTypeProps) => {
const styles = useStyles();
const { featureTypes } = useFeatureTypes()
const IconComponent = getFeatureTypeIcons(type);
const typeName = featureTypes.filter(t => t.id === type).map(t => t.name);
const title = `This is a "${typeName || type}" toggle`;
return (
<Tooltip arrow placement="right" title={type}>
<Tooltip arrow placement="right" title={title}>
<IconComponent
data-loading
className={styles.icon}