initial pass at media page
This commit is contained in:
parent
5ac22dff6c
commit
84d56cbeaa
11 changed files with 1224 additions and 58 deletions
21
components/PhotoGallery.tsx
Normal file
21
components/PhotoGallery.tsx
Normal file
|
@ -0,0 +1,21 @@
|
|||
import 'photoswipe/dist/photoswipe.css'
|
||||
import { Gallery, Item } from 'react-photoswipe-gallery'
|
||||
import Image from './Image'
|
||||
|
||||
const PhotoGallery = (props) => {
|
||||
const { title, data } = props
|
||||
|
||||
return (
|
||||
<Gallery>
|
||||
{data.length
|
||||
? data.map((d: string) => (
|
||||
<Item cropped key={d}>
|
||||
{({ ref, open }) => <Image alt={title} ref={ref} onClick={open} src={d} />}
|
||||
</Item>
|
||||
))
|
||||
: null}
|
||||
</Gallery>
|
||||
)
|
||||
}
|
||||
|
||||
export default PhotoGallery
|
Loading…
Add table
Add a link
Reference in a new issue