22 * License, v. 2.0. If a copy of the MPL was not distributed with this
33 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44
5- import React from 'react' ;
5+ import React , { lazy , Suspense } from 'react' ;
66import { RouteComponentProps } from '@reach/router' ;
7- import LegalWithMarkdown , {
8- FetchLegalDoc ,
9- } from '../../../components/LegalWithMarkdown' ;
7+ import { FetchLegalDoc } from '../../../components/LegalWithMarkdown' ;
108import { LegalDocFile } from '../../../lib/file-utils-legal' ;
9+ import LoadingSpinner from 'fxa-react/components/LoadingSpinner' ;
10+
11+ const LegalWithMarkdown = lazy (
12+ ( ) => import ( '../../../components/LegalWithMarkdown' )
13+ ) ;
1114
1215export const viewName = 'legal-terms' ;
1316
@@ -20,12 +23,14 @@ const LegalTerms = ({
2023 locale,
2124 fetchLegalDoc,
2225} : LegalTermsProps & RouteComponentProps ) => (
23- < LegalWithMarkdown
24- { ...{ locale, fetchLegalDoc, viewName } }
25- headingTextFtlId = "legal-terms-heading"
26- headingText = "Terms of Service"
27- legalDocFile = { LegalDocFile . terms }
28- />
26+ < Suspense fallback = { < LoadingSpinner fullScreen /> } >
27+ < LegalWithMarkdown
28+ { ...{ locale, fetchLegalDoc, viewName } }
29+ headingTextFtlId = "legal-terms-heading"
30+ headingText = "Terms of Service"
31+ legalDocFile = { LegalDocFile . terms }
32+ />
33+ </ Suspense >
2934) ;
3035
3136export default LegalTerms ;
0 commit comments