Skip to content

Commit

Permalink
[JSX] Add InfoPanel component (aces#8202)
Browse files Browse the repository at this point in the history
This adds an InfoPanel component to show a message to the
user in a box that's styled to draw their attention. The
"alert alert-info" bootstrap classes weren't working for me
with our current stylesheet, so the InfoPanel wraps around what's
needed to make it look reasonable and uses a FontAwesome icon to
mark it as an information panel.

Usage:
<InfoPanel>
Message that should go in the panel, can include arbitrary other
react or html if you want.
</InfoPanel>
  • Loading branch information
driusan authored Nov 2, 2022
1 parent a60559a commit 1549b59
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions jsx/InfoPanel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Display a message in an information panel.
*
* @param {object} props - React props
*
* @return {JSX}
*/
function InfoPanel(props) {
return (
<div className="alert alert-info"
style={{
backgroundColor: '#BEDFFF',
color: 'black',
display: 'flex',
flexBasis: 'row',
flexWrap: 'nowrap',
}}>
<div style={{
alignSelf: 'center',
padding: '1em',
}}>
<i style={{fontSize: '2em', color: 'blue'}}
className="fas fa-info-circle"></i>
</div>
<div style={{
paddingLeft: '1em',
alignSelf: 'center',
}}>{props.children}</div>
</div>
);
}

export default InfoPanel;

0 comments on commit 1549b59

Please sign in to comment.