From b3085e2b6b60d301fbd1df44466e003d90097637 Mon Sep 17 00:00:00 2001 From: Jesse Cohn Date: Fri, 24 Apr 2020 12:19:15 -0700 Subject: [PATCH] Added basic component for first flipper component --- .../686c-674/ViewDependentsCTA.jsx | 19 +++++++++++++++++++ .../686c-674/createViewDependentsCTA.js | 13 +++++++++++++ .../static-pages/static-pages-entry.js | 3 +++ src/applications/static-pages/widgetTypes.js | 1 + 4 files changed, 36 insertions(+) create mode 100644 src/applications/static-pages/686c-674/ViewDependentsCTA.jsx create mode 100644 src/applications/static-pages/686c-674/createViewDependentsCTA.js diff --git a/src/applications/static-pages/686c-674/ViewDependentsCTA.jsx b/src/applications/static-pages/686c-674/ViewDependentsCTA.jsx new file mode 100644 index 000000000000..e8cb977dab1a --- /dev/null +++ b/src/applications/static-pages/686c-674/ViewDependentsCTA.jsx @@ -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 =
We did a thing
; + } else { + content = ''; + } + return
{content}
; + } +} + +export default ViewDependentsCTA; diff --git a/src/applications/static-pages/686c-674/createViewDependentsCTA.js b/src/applications/static-pages/686c-674/createViewDependentsCTA.js new file mode 100644 index 000000000000..7471bfc7d628 --- /dev/null +++ b/src/applications/static-pages/686c-674/createViewDependentsCTA.js @@ -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(, root); + }); + } +} diff --git a/src/applications/static-pages/static-pages-entry.js b/src/applications/static-pages/static-pages-entry.js index 122137b12096..75efe15cf552 100644 --- a/src/applications/static-pages/static-pages-entry.js +++ b/src/applications/static-pages/static-pages-entry.js @@ -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'; @@ -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); diff --git a/src/applications/static-pages/widgetTypes.js b/src/applications/static-pages/widgetTypes.js index 2ffe59db2562..33a480ca0811 100644 --- a/src/applications/static-pages/widgetTypes.js +++ b/src/applications/static-pages/widgetTypes.js @@ -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', };