Skip to content

Commit

Permalink
Added basic component for first flipper component
Browse files Browse the repository at this point in the history
  • Loading branch information
cohnjesse committed Apr 24, 2020
1 parent bf2c63b commit b3085e2
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/applications/static-pages/686c-674/ViewDependentsCTA.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React, { Component } from 'react';

class ViewDependentsCTA extends Component {
state = {
isIncludedInFlipper: false,
};

render() {
let content;
if (this.state.isIncludedInFlipper === false) {
content = <div>We did a thing</div>;
} else {
content = '';
}
return <div>{content}</div>;
}
}

export default ViewDependentsCTA;
13 changes: 13 additions & 0 deletions src/applications/static-pages/686c-674/createViewDependentsCTA.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';
import ReactDOM from 'react-dom';

export default function createViewDependentsCTA(store, widgetType) {
const root = document.querySelector(`[data-widget-type="${widgetType}"]`);
if (root) {
import(/* webpackChunkName: "HomepageBanner" */
'./ViewDependentsCTA').then(module => {
const HomepageBanner = module.default;
ReactDOM.render(<HomepageBanner />, root);
});
}
}
3 changes: 3 additions & 0 deletions src/applications/static-pages/static-pages-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import createPost911GiBillStatusWidget, {
post911GIBillStatusReducer,
} from '../post-911-gib-status/createPost911GiBillStatusWidget';
import addLinkToCovidFAQ from './covidFaqLink';
import createViewDependentsCTA from './686c-674/createViewDependentsCTA';

// No-react styles.
import './sass/static-pages.scss';
Expand Down Expand Up @@ -132,6 +133,8 @@ createCoronavirusChatbot(store, widgetTypes.CORONAVIRUS_CHATBOT);

createHomepageBanner(store, widgetTypes.HOMEPAGE_BANNER);

createViewDependentsCTA(store, widgetTypes.VIEW_DEPENDENTS_CTA);

// homepage widgets
if (location.pathname === '/') {
createMyVALoginWidget(store);
Expand Down
1 change: 1 addition & 0 deletions src/applications/static-pages/widgetTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ export default {
HOMEPAGE_BANNER: 'homepage-banner',
POST_911_GI_BILL_STATUS_WIDGET: 'post-9-11-gi-bill-status',
CORONAVIRUS_CHATBOT: 'va-coronavirus-chatbot',
VIEW_DEPENDENTS_CTA: 'view-dependents-CTA',
};

0 comments on commit b3085e2

Please sign in to comment.