From 6924fdf7eedff4e57fde46218062d23957f07e7d Mon Sep 17 00:00:00 2001 From: ljc1991 Date: Thu, 2 Nov 2023 17:43:32 +0800 Subject: [PATCH] fix: change export to default export --- homepage/src/pages/admin/DecapCms.jsx | 10 ++++++---- homepage/src/pages/admin/index.jsx | 2 +- homepage/src/pages/admin/preview/CardPreview.jsx | 4 +++- homepage/src/pages/admin/preview/FooterPreview.jsx | 4 +++- homepage/src/pages/admin/preview/PagePreview.jsx | 4 +++- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/homepage/src/pages/admin/DecapCms.jsx b/homepage/src/pages/admin/DecapCms.jsx index 30b0116c..cd723b61 100644 --- a/homepage/src/pages/admin/DecapCms.jsx +++ b/homepage/src/pages/admin/DecapCms.jsx @@ -1,7 +1,7 @@ import dynamic from 'next/dynamic'; -import { PagePreview } from './preview/PagePreview'; -import { FooterPreview } from './preview/FooterPreview'; -import { CardPreview } from './preview/CardPreview'; +import PagePreview from './preview/PagePreview'; +import FooterPreview from './preview/FooterPreview'; +import CardPreview from './preview/CardPreview'; import config from './config.json'; @@ -13,7 +13,7 @@ const withAssetsByLocale = (Component, assetsByLocale) => { return WrappedComponent; }; -export const DecapCms = (assetsByLocale) => +const DecapCms = (assetsByLocale) => dynamic( () => import('decap-cms-app').then((cms) => { @@ -47,3 +47,5 @@ export const DecapCms = (assetsByLocale) => }), { ssr: false, loading: () =>

Loading...

}, ); + +export default DecapCms; diff --git a/homepage/src/pages/admin/index.jsx b/homepage/src/pages/admin/index.jsx index a55cdb22..6dcd2d62 100644 --- a/homepage/src/pages/admin/index.jsx +++ b/homepage/src/pages/admin/index.jsx @@ -3,7 +3,7 @@ import Script from 'next/script'; import { fetchCards } from '../../lib/fetchCards'; import { processCard } from '../../lib/processCard'; -import { DecapCms } from './DecapCms'; +import DecapCms from './DecapCms'; /** * diff --git a/homepage/src/pages/admin/preview/CardPreview.jsx b/homepage/src/pages/admin/preview/CardPreview.jsx index 0b6821d8..593dde80 100644 --- a/homepage/src/pages/admin/preview/CardPreview.jsx +++ b/homepage/src/pages/admin/preview/CardPreview.jsx @@ -1,7 +1,7 @@ import Card from '../../../components/cards/card'; import { processCard } from '../../../lib/processCard'; -export const CardPreview = ({ entry, getAsset, assetsByLocale }) => { +const CardPreview = ({ entry, getAsset, assetsByLocale }) => { const locale = 'en'; const assets = assetsByLocale[locale]; @@ -14,3 +14,5 @@ export const CardPreview = ({ entry, getAsset, assetsByLocale }) => { return ; }; + +export default CardPreview; diff --git a/homepage/src/pages/admin/preview/FooterPreview.jsx b/homepage/src/pages/admin/preview/FooterPreview.jsx index 42013d30..c88a81a3 100644 --- a/homepage/src/pages/admin/preview/FooterPreview.jsx +++ b/homepage/src/pages/admin/preview/FooterPreview.jsx @@ -1,6 +1,6 @@ import FooterLinks from '../../../layouts/footer/footerLinks'; -export const FooterPreview = ({ entry }) => { +const FooterPreview = ({ entry }) => { const footer = entry.getIn(['data', 'footer']); const links = footer ?.get('links') @@ -13,3 +13,5 @@ export const FooterPreview = ({ entry }) => { .toArray(); return ; }; + +export default FooterPreview; diff --git a/homepage/src/pages/admin/preview/PagePreview.jsx b/homepage/src/pages/admin/preview/PagePreview.jsx index 2326cf67..3cc57d89 100644 --- a/homepage/src/pages/admin/preview/PagePreview.jsx +++ b/homepage/src/pages/admin/preview/PagePreview.jsx @@ -1,7 +1,7 @@ import { componentMapper } from '../../../lib/componentMapper'; import contentMapper from '../../../layouts/contentMapper'; -export const PagePreview = ({ entry, assetsByLocale }) => { +const PagePreview = ({ entry, assetsByLocale }) => { const locale = 'en'; const assets = assetsByLocale[locale]; @@ -12,3 +12,5 @@ export const PagePreview = ({ entry, assetsByLocale }) => { }); return
{sections}
; }; + +export default PagePreview;