diff --git a/pages/Gallery.js b/pages/Gallery.js index 4fa30a5..39dd3b7 100644 --- a/pages/Gallery.js +++ b/pages/Gallery.js @@ -1,22 +1,17 @@ -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"; +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' import { Suspense } from 'react' -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"; +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' const APV = dynamic(() => import('./components/Videos'), { - ssr: false, + ssr: false }) const shimmer = (w, h) => ` @@ -32,138 +27,67 @@ const shimmer = (w, h) => ` ` -const toBase64 = (str) => - typeof window === 'undefined' - ? Buffer.from(str).toString('base64') - : window.btoa(str) +const toBase64 = str => (typeof window === 'undefined' ? Buffer.from(str).toString('base64') : window.btoa(str)) -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 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 } - 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; - } - - setJustifyActive(value); - }; - return ( -
- - -
-

گالری بیمارستان

- درباره بیارستان مهر ایرانیان پرند -
-
- - - {/* ویدئو ها */} - تصاویر - - - -
- Filter(2)} color={filterId === 2 ? 'light' : 'light'} className={filterId === 2 ? 'm-2' : 'm-2 text-dark'}>تصاویر در حال ساخت - Filter(1)} color={filterId === 1 ? 'light' : 'light'} className={'m-2'}>تصاویر معماری - AllImage()} color={filterId !== 1 && 2 ? 'light' : 'light'} className={'m-2'}>همه تصاویر -
- - - {Images && Images.dataImage.map((image, index) => { - return ( - -
- {image.title} { - lightBoxHandler(true, index); - }} - /> -
- {image.title} -
-
- ) - })} -
- -
-
-
-
-
-
- -
- ); -}; -export async function getServerSideProps(context) { - const res = await axios.get(AppUrl('GetGalleyImages')); - return { - props: { - dataImage: res.data - }, // will be passed to the page component as props - } + setJustifyActive(value) + } + return ( +
+ + +
+ ) } -export default Gallery; \ No newline at end of file +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 diff --git a/pages/News.js b/pages/News.js index db95cae..98339a8 100644 --- a/pages/News.js +++ b/pages/News.js @@ -1,41 +1,70 @@ -import React from 'react'; +import React from 'react' import { - MDBCard, - MDBCardImage, - MDBCardBody, - MDBCardTitle, - MDBCardText, - MDBRow, - MDBCol, - MDBContainer, MDBCardHeader, MDBBtn, MDBIcon, MDBInputGroupText, MDBTypography -} from 'mdb-react-ui-kit'; -import axios from "axios"; -import Link from "next/link"; -import AppContainer from "./appContainer"; + MDBCard, + MDBCardImage, + MDBCardBody, + MDBCardTitle, + MDBCardText, + MDBRow, + MDBCol, + MDBContainer, + MDBCardHeader, + MDBBtn, + MDBIcon, + MDBInputGroupText, + MDBTypography +} from 'mdb-react-ui-kit' +import axios from 'axios' +import Link from 'next/link' +import AppContainer from './appContainer' import { useRouter } from 'next/router' -import {AppUrl} from "../lib/api"; -import {DownloadIcon} from "@chakra-ui/icons"; +import { AppUrl } from '../lib/api' +import { DownloadIcon } from '@chakra-ui/icons' -const News = ({data, children}) => { - const router = useRouter(); - const query = router.query.list; +const News = ({ data, children }) => { + const router = useRouter() + const query = router.query.list - const dataPage = ( -
-
اطلاعیه ها
-
-
- - - دانلود دفترچه معرفی و فروش سهام عمومی بیمارستان تخصصی مهر پرند - - - - دانلود طرح توجیهی بیمارستان تخصصی مهر ایرانیان پرند - -
-
- + const dataPage = ( +
+
+ اطلاعیه ها{' '} +
+
+
+ + + + {' '} + دانلود دفترچه معرفی و فروش سهام عمومی بیمارستان تخصصی مهر پرند + + + + + + {' '} + دانلود طرح توجیهی بیمارستان تخصصی مهر ایرانیان پرند + + +
+
+ {/* {data && data.map(({ id, slug, title }) => ( @@ -55,27 +84,22 @@ const News = ({data, children}) => { ))} - - {children} -
- ) - return ( -
- {/* {query ? : dataPage} */} -
- ); -}; +
*/} + {children} +
+ ) + return
{/* {query ? : dataPage} */}
+} -export default News; +export default News - -export const getServerSideProps = async (context) => { - const allPostsData = await axios.get(AppUrl('news')); - const data = await allPostsData.data; - return { - props: { - data, - fallback:false - }, // will be passed to the page component as props - } -} \ No newline at end of file +export const getServerSideProps = async context => { +// const allPostsData = await axios.get(AppUrl('news')) +// const data = await allPostsData.data + return { + props: { + data: null, + fallback: false + } // will be passed to the page component as props + } +} diff --git a/pages/index.js b/pages/index.js index e251549..e4406d8 100644 --- a/pages/index.js +++ b/pages/index.js @@ -2,13 +2,7 @@ import AppContainer from './appContainer' import Slider from './components/slider' import News from './News' import axios from 'axios' -import { - MDBBtn, - MDBCard, - MDBCardBody, - MDBContainer, - MDBIcon, -} from 'mdb-react-ui-kit' +import { MDBBtn, MDBCard, MDBCardBody, MDBContainer, MDBIcon } from 'mdb-react-ui-kit' import Link from 'next/link' import Paralax from './components/Paralax' import Service from './components/service' @@ -41,11 +35,11 @@ export default function Home({ data_NEWS }) {
- - - ارتباط با ما - - + + + ارتباط با ما + + {/* مشاوره سرمایه گذاری @@ -114,10 +108,10 @@ export default function Home({ data_NEWS }) { } export const getServerSideProps = async context => { - const allPostsData = await axios.get(AppUrl('news')) - const data_NEWS = await allPostsData.data.slice(0, 6) + // const allPostsData = await axios.get(AppUrl('news')) + // const data_NEWS = await allPostsData.data.slice(0, 6) return { - props: { data_NEWS, fallback: false } // will be passed to the page component as props + props: { data_NEWS: null, fallback: false } // will be passed to the page component as props } }