feat(shared): Modal for all MDX and Strapi content
This commit is contained in:
parent
39dd5ebaa2
commit
0b40f6f347
9 changed files with 84 additions and 42 deletions
|
@ -1,6 +1,8 @@
|
|||
import Popout from 'shared/components/popout'
|
||||
import Modal from 'shared/components/modal'
|
||||
|
||||
const Figure = props => {
|
||||
|
||||
const title = props?.title
|
||||
? props.title
|
||||
: props?.alt
|
||||
|
@ -9,21 +11,23 @@ const Figure = props => {
|
|||
|
||||
return (
|
||||
<figure className="block my-4">
|
||||
<img
|
||||
src={props?.src}
|
||||
alt={props?.alt || ''}
|
||||
title={title || ''}
|
||||
className="m-auto"
|
||||
/>
|
||||
{title
|
||||
? <figcaption className="text-center italic text-base-content mt-1">{title}</figcaption>
|
||||
: (
|
||||
<Popout fixme>
|
||||
<h5>This image does not have an alt of title specified</h5>
|
||||
<p>Please improve our documentation and fix this.</p>
|
||||
</Popout>
|
||||
)
|
||||
}
|
||||
<Modal>
|
||||
<img
|
||||
src={props?.src}
|
||||
alt={props?.alt || ''}
|
||||
title={title || ''}
|
||||
className="m-auto max-h-full max-w-full"
|
||||
/>
|
||||
{title
|
||||
? <figcaption className="text-center italic text-base-content mt-1">{title}</figcaption>
|
||||
: (
|
||||
<Popout fixme>
|
||||
<h5>This image does not have an alt of title specified</h5>
|
||||
<p>Please improve our documentation and fix this.</p>
|
||||
</Popout>
|
||||
)
|
||||
}
|
||||
</Modal>
|
||||
</figure>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue