React - component examples

0 votes
93 views
added May 10, 2019 in React by LC Marshal Captain (25,770 points)
// Breadcrumb component
import React from 'react';

class TransactionBreadcrumbComponent extends React.Component {

    render () {
        const transCat = 'Category',
              transPg = 'Page',
              backTransHome = "javascript:history.back()";
         
        return (
            <div className="breadcrumb-container  d-none d-lg-block">
              <div className="container-fluid">
                <nav aria-label="breadcrumb">
                  <ol className="breadcrumb">
                    <li className="breadcrumb-item"><a href="#"><i className="material-icons home-icon">home</i></a></li>
                    <li className="breadcrumb-item"><a onClick={transCat}>{transCat}</a></li>
                    <li className="breadcrumb-item"><a onClick={transPg}>{transPg}</a></li>
                  </ol>
                  <span className="back-search">
                    <a href={backTransHome}>
                      <i className="material-icons back-button">arrow_back</i>
                      Back to Transaction Home
                    </a>
                  </span>
                </nav>
                
              </div>
            </div>
            
          );
    }
}
export default TransactionBreadcrumbComponent;

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...