Files
mip-website/pages/Gallery.js
T

94 lines
2.9 KiB
JavaScript
Raw Normal View History

2025-12-18 10:13:52 +03:30
import React, { useEffect, useState } from 'react'
import axios from 'axios'
import AppContainer from './appContainer'
import { AppFile, AppUrl } from '../lib/api'
import Image from 'next/image'
import dynamic from 'next/dynamic'
2023-07-12 15:37:34 +03:30
import { Suspense } from 'react'
2025-12-18 10:13:52 +03:30
import { MDBBtn, MDBCol, MDBContainer, MDBRow } from 'mdb-react-ui-kit'
import { LightBox } from 'react-lightbox-pack'
import { Button, Divider, Tab, TabList, TabPanel, TabPanels, Tabs } from '@chakra-ui/react'
2023-07-12 15:37:34 +03:30
const APV = dynamic(() => import('./components/Videos'), {
2025-12-18 10:13:52 +03:30
ssr: false
2023-07-12 15:37:34 +03:30
})
const shimmer = (w, h) => `
<svg width="${w}" height="${h}" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="g">
<stop stop-color="#333" offset="20%" />
<stop stop-color="#222" offset="50%" />
<stop stop-color="#333" offset="70%" />
</linearGradient>
</defs>
<rect width="${w}" height="${h}" fill="#333" />
<rect id="r" width="${w}" height="${h}" fill="url(#g)" />
<animate xlink:href="#r" attributeName="x" from="-${w}" to="${w}" dur="1s" repeatCount="indefinite" />
</svg>`
2025-12-18 10:13:52 +03:30
const toBase64 = str => (typeof window === 'undefined' ? Buffer.from(str).toString('base64') : window.btoa(str))
2023-07-12 15:37:34 +03:30
2025-12-18 10:13:52 +03:30
const Gallery = dataImage => {
const [Images, SetImages] = useState(dataImage)
const [justifyActive, setJustifyActive] = React.useState('tab1')
const [toggle, setToggle] = React.useState(false)
const [sIndex, setSIndex] = React.useState(0)
const [filterId, setFilterId] = React.useState(1)
const Parallax = ({ quality }) => {
return `../resource/parallax/Gallery.jpg`
}
// const Filter = async filter => {
// const res = await axios.get(AppUrl(`FilterGalleyImages/${filter}`))
// SetImages({ dataImage: res.data })
// setFilterId(filter)
// }
// const AllImage = async () => {
// const res = await axios.get(AppUrl(`GetGalleyImages`))
// SetImages({ dataImage: res.data })
// }
// Handler
// const lightBoxHandler = (state, sIndex) => {
// setToggle(state)
// setSIndex(sIndex)
// }
const handleJustifyClick = value => {
if (value === justifyActive) {
return
2023-07-12 15:37:34 +03:30
}
2025-08-22 12:41:44 +03:30
2025-12-18 10:13:52 +03:30
setJustifyActive(value)
}
return (
<div>
<style jsx>
{`
.cardImage {
background-color: #f3f4f6;
padding: 5px;
border-radius: 1rem;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin: 2px;
}
`}
</style>
<AppContainer></AppContainer>
</div>
)
2023-07-12 15:37:34 +03:30
}
2025-12-18 10:13:52 +03:30
export async function getServerSideProps(context) {
// const res = await axios.get(AppUrl('GetGalleyImages'));
return {
props: {
dataImage: null
} // will be passed to the page component as props
}
}
export default Gallery