Add new feature notice, solid border in community

This commit is contained in:
Maciej Ziarkowski 2021-10-11 14:13:02 +02:00
parent ad8b4343d3
commit 25a4bb7e0d
3 changed files with 10 additions and 6 deletions

View File

@ -1,5 +1,5 @@
.community-opinion-pane {
padding-top: 0.5em;
padding-bottom: 0.5em;
border-bottom: 1px dashed gray;
border-bottom: 1px solid gray;
}

View File

@ -20,6 +20,9 @@ import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-e
const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
const worthKeepingReasonsNonEmpty = Object.values(props.building.community_type_worth_keeping_reasons ?? {}).some(x => x);
return <>
<InfoBox type='warning'>
We are testing a new feature in this section! Switch between different colour maps by using the dropdown in the legend pane.
</InfoBox>
<div className='community-opinion-pane'>
<InfoBox>
Can you share your opinion on how well the building works?

View File

@ -2,15 +2,16 @@ import React from 'react';
interface InfoBoxProps {
msg?: string;
type?: 'info' | 'warning'
}
const InfoBox: React.FC<InfoBoxProps> = (props) => (
const InfoBox: React.FC<InfoBoxProps> = ({msg, children, type = 'info'}) => (
<>
{
(props.msg || props.children) &&
<div className="alert alert-info" role="alert">
{ props.msg ?? '' }
{ props.children }
(msg || children) &&
<div className={`alert alert-${type}`} role="alert">
{ msg ?? '' }
{ children }
</div>
}
</>