mirror of
https://github.com/Unleash/unleash.git
synced 2025-06-14 01:16:17 +02:00
fix: adjust tooltip for toggle type
This commit is contained in:
parent
fea7707551
commit
0ddd52a8ba
@ -51,7 +51,7 @@ exports[`renders correctly with one feature 1`] = `
|
|||||||
onMouseOver={[Function]}
|
onMouseOver={[Function]}
|
||||||
onTouchEnd={[Function]}
|
onTouchEnd={[Function]}
|
||||||
onTouchStart={[Function]}
|
onTouchStart={[Function]}
|
||||||
title={null}
|
title="This is a \\"\\" toggle"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
>
|
>
|
||||||
<path
|
<path
|
||||||
@ -186,7 +186,7 @@ exports[`renders correctly with one feature without permission 1`] = `
|
|||||||
onMouseOver={[Function]}
|
onMouseOver={[Function]}
|
||||||
onTouchEnd={[Function]}
|
onTouchEnd={[Function]}
|
||||||
onTouchStart={[Function]}
|
onTouchStart={[Function]}
|
||||||
title={null}
|
title="This is a \\"\\" toggle"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
>
|
>
|
||||||
<path
|
<path
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { useStyles } from './FeatureType.styles';
|
import { useStyles } from './FeatureType.styles';
|
||||||
import { Tooltip } from '@material-ui/core';
|
import { Tooltip } from '@material-ui/core';
|
||||||
import { getFeatureTypeIcons } from '../../../../utils/get-feature-type-icons';
|
import { getFeatureTypeIcons } from '../../../../utils/get-feature-type-icons';
|
||||||
|
import useFeatureTypes from '../../../../hooks/api/getters/useFeatureTypes/useFeatureTypes';
|
||||||
|
|
||||||
|
|
||||||
interface FeatureTypeProps {
|
interface FeatureTypeProps {
|
||||||
@ -9,10 +10,15 @@ interface FeatureTypeProps {
|
|||||||
|
|
||||||
const FeatureStatus = ({ type }: FeatureTypeProps) => {
|
const FeatureStatus = ({ type }: FeatureTypeProps) => {
|
||||||
const styles = useStyles();
|
const styles = useStyles();
|
||||||
|
const { featureTypes } = useFeatureTypes()
|
||||||
const IconComponent = getFeatureTypeIcons(type);
|
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 (
|
return (
|
||||||
<Tooltip arrow placement="right" title={type}>
|
<Tooltip arrow placement="right" title={title}>
|
||||||
<IconComponent
|
<IconComponent
|
||||||
data-loading
|
data-loading
|
||||||
className={styles.icon}
|
className={styles.icon}
|
||||||
|
Loading…
Reference in New Issue
Block a user