diff --git a/storybook-static/README.TXT b/node/STORYBOOK-README.TXT similarity index 100% rename from storybook-static/README.TXT rename to node/STORYBOOK-README.TXT diff --git a/src/App.jsx b/src/App.jsx index deca613ab..b33072313 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -20,7 +20,6 @@ import { isCordova, isWebApp } from './js/common/utils/isCordovaOrWebApp'; import { renderLog } from './js/common/utils/logging'; import Header from './js/components/Navigation/Header'; import HeaderBarSuspense from './js/components/Navigation/HeaderBarSuspense'; -import StorybookRedirect from './js/components/Widgets/StorybookRedirect'; import webAppConfig from './js/config'; import VoterStore from './js/stores/VoterStore'; import initializeFacebookSDK from './js/utils/initializeFacebookSDK'; @@ -363,6 +362,12 @@ class App extends Component { The props.match.path shows exactly which route string from this file, was selected by the */ + if (window.location.href.endsWith('/storybook')) { + const destinationHref = `${window.location.href}-static/index.html?path=/docs/design-system--docs`; + console.log('Storybook redirect from: ', window.location.href, ' to: ', destinationHref); + window.location.href = destinationHref; + } + return ( <> {enableFullStory && } @@ -551,7 +556,6 @@ class App extends Component { - diff --git a/src/js/components/Widgets/StorybookRedirect.jsx b/src/js/components/Widgets/StorybookRedirect.jsx deleted file mode 100644 index ae049c55d..000000000 --- a/src/js/components/Widgets/StorybookRedirect.jsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import { renderLog } from '../../common/utils/logging'; - - -// React functional component example -export default function StorybookRedirect () { - renderLog('StorybookRedirect functional component'); - - return ( - Redirect to Html page - ); -} diff --git a/webpack.config.js b/webpack.config.js index 0a269cd3f..e3378a920 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -135,7 +135,8 @@ module.exports = (env, argv) => ({ to: 'img/', globOptions: { ignore: ['**/DO-NOT-BUNDLE/**']}, }, - { from: 'storybook-static', to: './storybook' }, + { from: 'node/STORYBOOK-README.TXT', to: './storybook-static/STORYBOOK-README.TXT' }, + { from: 'storybook-static', to: './storybook-static' }, ], }), new MomentLocalesPlugin(),