Skip to content

Commit

Permalink
Merge pull request #3832 from SailingSteve/steveWebAppFeb16-318pm
Browse files Browse the repository at this point in the history
Added building and access via webapp to the Storybook design inventory (Part 2)
  • Loading branch information
DaleMcGrew authored Feb 18, 2024
2 parents b3f6d9e + 7f1f25e commit 31fa01b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
File renamed without changes.
8 changes: 6 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -363,6 +362,12 @@ class App extends Component {
The props.match.path shows exactly which route string from this file, was selected by the <Switch>
*/

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 && <FullStory org={webAppConfig.FULL_STORY_ORG} />}
Expand Down Expand Up @@ -551,7 +556,6 @@ class App extends Component {
<Route path="/sign_in_email/:email_secret_key" component={SignInEmailProcess} />
<Route path="/setupaccount/:set_up_page" exact component={SetUpAccountRoot} />
<Route path="/setupaccount" exact><SetUpAccountRoot /></Route>
<Route path="/storybook"><StorybookRedirect /></Route>
<Route path="/squads" exact><Squads /></Route>
<Route exact path="/start-a-campaign"><CampaignStartIntro /></Route>
<Route path="/terms" component={TermsOfService} />
Expand Down
12 changes: 0 additions & 12 deletions src/js/components/Widgets/StorybookRedirect.jsx

This file was deleted.

3 changes: 2 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 31fa01b

Please sign in to comment.