Skip to content

Commit

Permalink
Impl [UI] Add metric type icons to Metrics Selector dropdown (#2472)
Browse files Browse the repository at this point in the history
  • Loading branch information
Taras-Hlukhovetskyi committed May 30, 2024
1 parent 2742ba1 commit 6eaed1f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/elements/MetricsSelector/MetricsSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ import { METRICS_SELECTOR_OPTIONS } from '../../types'

import { ReactComponent as Arrow } from 'igz-controls/images/arrow.svg'
import { ReactComponent as SearchIcon } from 'igz-controls/images/search.svg'
import { ReactComponent as MetricIcon } from 'igz-controls/images/circled-m.svg'
import { ReactComponent as ResultIcon } from 'igz-controls/images/circled-r.svg'

import './metricsSelector.scss'

Expand Down Expand Up @@ -146,10 +148,7 @@ const MetricsSelector = ({ maxSelectionNumber, metrics, name, onSelect, preselec
style={{ backgroundColor: metric.color }}
/>
<span className="data-ellipsis">{metric.name}</span>
{/*// todo: metrics - change according to design when ready */}
<span style={{ marginLeft: '5px' }}>
{metric.type === metricsTypes.metric ? ' (M)' : ' (R)'}
</span>
{metric.type === metricsTypes.metric ? <MetricIcon /> : <ResultIcon />}
</>
)
}
Expand Down
18 changes: 18 additions & 0 deletions src/elements/MetricsSelector/metricsSelector.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
font-size: 15px;
white-space: nowrap;
text-overflow: ellipsis;

svg {
margin-left: auto;
}
}

.metrics-selector-color-indicator {
Expand All @@ -74,6 +78,20 @@
background-color: transparent;
border-radius: 50%;
}

&.disabled {
label {
.metrics-selector-color-indicator {
opacity: 0.3;
}

svg {
path {
fill: $spunPearl;
}
}
}
}
}
}
}
Expand Down

0 comments on commit 6eaed1f

Please sign in to comment.