src/applications/static-pages/simple-forms/20-10206/App.js
import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { toggleValues } from 'platform/site-wide/feature-toggles/selectors';
import FEATURE_FLAG_NAMES from 'platform/utilities/feature-toggles/featureFlagNames';
const App = ({ formEnabled }) => {
if (formEnabled === undefined) {
return <va-loading-indicator message="Loading..." />;
}
if (formEnabled) {
return (
<>
<p>You can submit this form online or by mail.</p>
<a
className="vads-c-action-link--blue"
href="/records/request-personal-records-form-20-10206"
>
Request personal records online
</a>
</>
);
}
return <p>You can submit this form by mail.</p>;
};
App.propTypes = {
formEnabled: PropTypes.bool,
};
const mapStateToProps = store => ({
formEnabled: toggleValues(store)[FEATURE_FLAG_NAMES.form2010206],
});
export default connect(mapStateToProps)(App);