react-bootstrap#Panel JavaScript Examples

The following examples show how to use react-bootstrap#Panel. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Profile.js    From React-Messenger-App with MIT License 6 votes vote down vote up
render() {
  // Using destructuring assignment to set the constant profile to the state
  const { profile } = this.state;
  return (
    <div className="container">
      <div className="profile-area">
        <h1>{profile.name}</h1>
        <Panel header="Profile">
        <img src={profile.picture} alt="profile" />
            <div>
              <ControlLabel><Glyphicon glyph="user" /> Nickname</ControlLabel>
              <h3>{profile.nickname}</h3>
            </div>
            <pre>{JSON.stringify(profile, null, 2)}</pre>
          </Panel>
        </div>
      </div>
    );
  }
Example #2
Source File: InformationPanelContainer.jsx    From mapstore2-cadastrapp with GNU General Public License v3.0 6 votes vote down vote up
export default function InformationPanelContainer({ items = [], authLevel, additionalData = {}, infoLoading = []}) {
    const [selectedPanel, togglePanel] = useAccordionState();
    const [firstToggle, setFirstToggle] = useState(false);
    // Open first result on startup.
    useEffect(() => {
        if (!firstToggle && items.length > 0) {
            setFirstToggle(true);
            togglePanel("0");

        }
    }, [items]);
    return (<PanelGroup
        onSelect={i => togglePanel(i)}
    >{
            items.map((r, index) => {
                let header = (<div
                    onClick={() => { togglePanel(index); }}
                    className={`information-panel-title ${selectedPanel[index] ? 'selected' : 'unselected'}`}>
                    {r.parcelle}
                    {infoLoading[r?.parcelle] ? <div style={{ "float": "right" }}><Spinner spinnerName="circle" noFadeIn overrideSpinnerClassName="spinner" /></div> : null}
                </div>);
                return (
                    <Panel
                        expanded={!!selectedPanel[index.toString()]}
                        className="mapstore-side-card ms-sm"
                        collapsible
                        eventKey={index.toString()}
                        header={header}>
                        <InformationContent {...r} authLevel={authLevel} additionalData={additionalData}/>
                    </Panel>
                );
            })
        }
    </PanelGroup>);
}
Example #3
Source File: Description.jsx    From mapstore2-cadastrapp with GNU General Public License v3.0 6 votes vote down vote up
function PanelContainer({ article40 = [], article50 = [], article60 = [] }) {
    const [selectedPanel, togglePanel] = useAccordionState();
    const [firstToggle, setFirstToggle] = useState(false);
    const items = article40.map(i => ({ articleType: "article40", ...i}))
        .concat(article50.map(i => ({ articleType: "article50", ...i })))
        .concat(article60.map(i => ({ articleType: "article60", ...i })));
    // Open first result on startup.
    useEffect(() => {
        if (!firstToggle && items.length > 0) {
            setFirstToggle(true);
            togglePanel("0");

        }
    }, [items]);
    return (<PanelGroup
        onSelect={i => togglePanel(i)}
    >{
            // example of no data : 350238000AD0055 --> Batiment T
            items.length === 0 ? <Message msgId="cadastrapp.nodata" /> : items.map((r, index) => {
                let header = <div onClick={() => { togglePanel(index); }} className={`information-panel-title ${selectedPanel[index] ? 'selected' : 'unselected'}`}><ArticleHeader {...r}/></div>;
                return (
                    <Panel
                        expanded={!!selectedPanel[index.toString()]}
                        className="mapstore-side-card ms-sm"
                        collapsible
                        eventKey={index.toString()}
                        header={header}>
                        <ArticlePanel {...r} />
                    </Panel>
                );
            })
        }
    </PanelGroup>);
}