-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: lazy loading components to improve bundle size (#4)
* chore: lazy loading components to improve boundle size * fix: typo * chore: fix typo
- Loading branch information
1 parent
cfe9925
commit 102445b
Showing
6 changed files
with
72 additions
and
20 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React, { useState } from 'react'; | ||
import { TextArea, Form } from 'semantic-ui-react'; | ||
import { defineMessages } from 'react-intl'; | ||
|
||
const FormHeader = ({ title, step, totalSteps, className }) => { | ||
return ( | ||
<div className={className}> | ||
<h6>{title}</h6> | ||
<div>{`${step}/${totalSteps}`}</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default FormHeader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,25 @@ | ||
export { FormHeader } from './FeedbackForm/Steps/Commons'; | ||
export FeedbackForm from './FeedbackForm/FeedbackForm'; | ||
export AnswersStep from './FeedbackForm/Steps/AnswersStep'; | ||
export CommentsStep from './FeedbackForm/Steps/CommentsStep'; | ||
import loadable from '@loadable/component'; | ||
|
||
/*-------------------------------- | ||
--- BUNDLE VoltoFeedbackView --- | ||
---------------------------------*/ | ||
export const FormHeader = loadable(() => | ||
import( | ||
/* webpackChunkName: "VoltoFeedbackView" */ './FeedbackForm/Steps/Commons/FormHeader' | ||
), | ||
); | ||
export const FeedbackForm = loadable(() => | ||
import( | ||
/* webpackChunkName: "VoltoFeedbackView" */ './FeedbackForm/FeedbackForm' | ||
), | ||
); | ||
export const AnswersStep = loadable(() => | ||
import( | ||
/* webpackChunkName: "VoltoFeedbackView" */ './FeedbackForm/Steps/AnswersStep' | ||
), | ||
); | ||
export const CommentsStep = loadable(() => | ||
import( | ||
/* webpackChunkName: "VoltoFeedbackView" */ './FeedbackForm/Steps/CommentsStep' | ||
), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,19 @@ | ||
export VFPanel from './VFPanel/VFPanel'; | ||
export VFPanelMenu from './VFPanel/VFPanelMenu'; | ||
export FeedbackComments from './VFPanel/FeedbackComments'; | ||
export VFToolbar from './VFToolbar'; | ||
import loadable from '@loadable/component'; | ||
|
||
/*-------------------------------- | ||
--- BUNDLE VoltoFeedbackManage --- | ||
---------------------------------*/ | ||
export const VFPanel = loadable(() => | ||
import(/* webpackChunkName: "VoltoFeedbackManage" */ './VFPanel/VFPanel'), | ||
); | ||
export const VFPanelMenu = loadable(() => | ||
import(/* webpackChunkName: "VoltoFeedbackManage" */ './VFPanel/VFPanelMenu'), | ||
); | ||
export const FeedbackComments = loadable(() => | ||
import( | ||
/* webpackChunkName: "VoltoFeedbackManage" */ './VFPanel/FeedbackComments' | ||
), | ||
); | ||
export const VFToolbar = loadable(() => | ||
import(/* webpackChunkName: "VoltoFeedbackManage" */ './VFToolbar'), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
export HoneypotWidget from './HoneypotWidget/HoneypotWidget'; | ||
export GoogleReCaptchaWidget from './GoogleReCaptchaWidget'; | ||
import loadable from '@loadable/component'; | ||
|
||
/*-------------------------------- | ||
--- BOUNDLE VoltoFeedbackView --- | ||
---------------------------------*/ | ||
export const HoneypotWidget = loadable(() => | ||
import( | ||
/* webpackChunkName: "VoltoFeedbackView" */ './HoneypotWidget/HoneypotWidget' | ||
), | ||
); | ||
export const GoogleReCaptchaWidget = loadable(() => | ||
import(/* webpackChunkName: "VoltoFeedbackView" */ './GoogleReCaptchaWidget'), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters