Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FLAG-1215: add check to display custom text for Indigenous layer #4924

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,24 @@ class LayerStatement extends PureComponent {
tooltipDesc,
} = this.props;

return tooltipDesc ? (
let statementTitle = statementPlain;
let statementDesc = statementHighlight;
let tooltip = tooltipDesc;

// TODO: how to refactor this? where to put it
if (
[
'Indigenous and Community Lands (Polygons)',
'Indigenous and Community Lands (Points)',
].includes(this.props.activeLayer?.name)
) {
statementTitle =
'Note that the absence of data does not indicate the absence of Indigenous or Community land.';
statementDesc = '';
tooltip = undefined;
}

return tooltip ? (
<Tooltip
theme="tip"
hideOnClick
Expand All @@ -26,12 +43,12 @@ class LayerStatement extends PureComponent {
animateFill={false}
>
<div className={cx('c-layer-statement', className)}>
{statementPlain}
<span>{statementHighlight}</span>
{statementTitle}
<span>{statementDesc}</span>
</div>
</Tooltip>
) : (
<div className={cx('c-layer-statement', className)}>{statementPlain}</div>
<div className={cx('c-layer-statement', className)}>{statementTitle}</div>
);
}
}
Expand All @@ -42,6 +59,7 @@ LayerStatement.propTypes = {
statementPlain: PropTypes.string,
statementHighlight: PropTypes.string,
tooltipDesc: PropTypes.string,
activeLayer: PropTypes.object,
};

export default LayerStatement;
Loading