diff options
| author | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-05-08 16:44:09 +0700 |
|---|---|---|
| committer | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-05-08 16:44:09 +0700 |
| commit | 486f85a45fc7e0669576f59824a31be472ed25bb (patch) | |
| tree | 0268afa8efe48746e040611ba41ad2cafda7ad08 /src/lib/content/components/PageContent.jsx | |
| parent | cff198277e14450f8d20d9e18548325e6f277682 (diff) | |
| parent | 30fc50600009ca54f085d594d838803c107e87f2 (diff) | |
Merge branch 'master' into development_tri/implementasi_raja_ongkir
# Conflicts:
# src/lib/checkout/components/Checkout.jsx
Diffstat (limited to 'src/lib/content/components/PageContent.jsx')
| -rw-r--r-- | src/lib/content/components/PageContent.jsx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/lib/content/components/PageContent.jsx b/src/lib/content/components/PageContent.jsx index 61e5381d..8c467999 100644 --- a/src/lib/content/components/PageContent.jsx +++ b/src/lib/content/components/PageContent.jsx @@ -6,13 +6,21 @@ const PageContent = ({ path }) => { const fetchContent = async () => await pageContentApi({ path }) const content = useQuery(`content-${path}`, fetchContent) + if (content.isLoading) { + return ( + <div className='flex justify-center my-6'> + <Spinner className='w-6 text-gray_r-12/50 fill-gray_r-12' /> + </div> + ) + } + if (content.data?.id) { let parsedContent = content.data.content parsedContent = parsedContent.replaceAll( 'src="/web/image', `src="${process.env.NEXT_PUBLIC_ODOO_API_HOST}/web/image` ) - const contentClassNames = ` + const contentClassNames = ` prose prose-gray prose-a:text-danger-500 @@ -23,19 +31,12 @@ const PageContent = ({ path }) => { prose-img:mb-1 prose-img:inline-block prose-hr:my-3 + max-w-none ` return <div className={contentClassNames} dangerouslySetInnerHTML={{ __html: parsedContent }} /> } - if (content.isLoading) { - return ( - <div className='flex justify-center my-6'> - <Spinner className='w-6 text-gray_r-12/50 fill-gray_r-12' /> - </div> - ) - } - return <></> } |
