-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Graph option Show Measures for Selection (PT-187459320) (#1287)
* feat: Graph option Show Measures for Selection (PT-187459320) [#187459320](https://www.pivotaltracker.com/story/show/187459320)
- Loading branch information
Showing
5 changed files
with
77 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
v3/src/components/graph/adornments/measures-for-selection-banner.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@use "../../vars.scss" as *; | ||
|
||
.measures-for-selection-banner { | ||
background: $background-fill; | ||
border: none; | ||
color: #000; | ||
display: flex; | ||
flex-direction: column; | ||
font: 12px "MuseoSans-500", sans-serif; | ||
justify-content: center; | ||
line-height: 1; | ||
min-height: 22px; | ||
overflow: hidden; | ||
padding: 0 5px; | ||
pointer-events: all; | ||
text-align: left; | ||
width: calc(100% - 10px); | ||
} |
19 changes: 19 additions & 0 deletions
19
v3/src/components/graph/adornments/measures-for-selection-banner.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from "react" | ||
import { observer } from "mobx-react-lite" | ||
import { t } from "../../../utilities/translation/translate" | ||
import { useGraphDataConfigurationContext } from "../hooks/use-graph-data-configuration-context" | ||
|
||
import "./measures-for-selection-banner.scss" | ||
|
||
export const MeasuresForSelectionBanner = observer(function MeasuresForSelectionBanner() { | ||
const dataConfig = useGraphDataConfigurationContext() | ||
const content = dataConfig?.selection.length === 1 | ||
? t("DG.SelectedInfoView.infoSing", { vars: [1] }) | ||
: t("DG.SelectedInfoView.infoPlural", { vars: [dataConfig?.selection.length] }) | ||
|
||
return ( | ||
<div className="measures-for-selection-banner" data-testid="measures-for-selection-banner"> | ||
{content} | ||
</div> | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters