|

   Veteran Tools Platform - Developer Documentation

There are no notes for this item.

PropRequired?TypeDefaultDescription
messageLine1 Yes string
messageLine2 No string
<div id="reactMount" data-tpl="systemdownview">
    <div class="row">
        <div class="small-12 columns">
            <div class="react-container">
                <h3>This is the message that shows when the system is down.</h3>
                <h4>This is an optional second line, for details or whatnot.</h4><a href="/"><button>Go Back to Vets.gov</button></a></div>
        </div>
    </div>
</div>
<script>
    window.currentProps = {
        "package": {
            "name": "department-of-veteran-affairs/jean-pants",
            "version": "0.1.0"
        },
        "assetPath": "/design-system/",
        "isProduction": true,
        "componentSourcePath": "SystemDownView.jsx",
        "messageLine1": "This is the message that shows when the system is down.",
        "messageLine2": "This is an optional second line, for details or whatnot."
    }
</script>
import React from 'react';
import SystemDownView from './SystemDownView';

export default function SystemDownViewExample(props) {
  return (
    <SystemDownView
      messageLine1={props.messageLine1}
      messageLine2={props.messageLine2}>
    </SystemDownView>
  );
}
package:
  name: department-of-veteran-affairs/jean-pants
  version: 0.1.0
assetPath: /design-system/
isProduction: true
componentSourcePath: SystemDownView.jsx
messageLine1: This is the message that shows when the system is down.
messageLine2: 'This is an optional second line, for details or whatnot.'
  • Content:
    import PropTypes from 'prop-types';
    import React from 'react';
    
    class SystemDownView extends React.Component {
      render() {
        return (
          <div className="row">
            <div className="small-12 columns">
              <div className="react-container">
                <h3>{this.props.messageLine1}</h3>
                <h4>{this.props.messageLine2}</h4>
                <a href="/"><button>Go Back to Vets.gov</button></a>
              </div>
            </div>
          </div>
        );
      }
    }
    
    SystemDownView.propTypes = {
    
      // first line of the system down message, required
      messageLine1: PropTypes.string.isRequired,
    
      // optional second line of messaging
      messageLine2: PropTypes.string,
    };
    
    export default SystemDownView;
    
  • URL: /components/raw/systemdownview/SystemDownView.jsx
  • Filesystem Path: src/components/SystemDownView/SystemDownView.jsx
  • Size: 707 Bytes
  • Content:
    import React from 'react';
    import { shallow } from 'enzyme';
    import { expect } from 'chai';
    import { axeCheck } from '../../../lib/testing/helpers';
    import SystemDownView from './SystemDownView.jsx';
    
    describe('<SystemDownView>', () => {
      it('should render', () => {
        const tree = shallow(<SystemDownView
          messageLine1="This is the first line"
          messageLine2="This is the second line"/>);
        expect(tree.text()).to.contain('This is the first line');
      });
    
      it('should pass aXe check', () => {
        return axeCheck(<SystemDownView
          messageLine1="This is the first line"
          messageLine2="This is the second line"/>);
      });
    
    });
    
  • URL: /components/raw/systemdownview/SystemDownView.unit.spec.jsx
  • Filesystem Path: src/components/SystemDownView/SystemDownView.unit.spec.jsx
  • Size: 649 Bytes