-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cinema.js
45 lines (41 loc) · 1.18 KB
/
Cinema.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import React, { useEffect, useState } from 'react'
import { Link } from 'react-router-dom'
import db from './firebase';
import Ci from './home pages/Ci';
function Cinema() {
const [cini, setcini] = useState([])
useEffect(()=>{
getpns();
},[]);
function getpns(){
db.collection('Cinema').orderBy('date','desc').limit(3).onSnapshot(function(querySnapshot){
setcini(
querySnapshot.docs.map((doc)=>({
id:doc.id,
title:doc.data().title,
subtitle:doc.data().Stitle,
image: doc.data().image,
desc: doc.data().description,
artlink:doc.data().artlink,
date:doc.data().date
}))
);
});
}
return (
<div className='Polihome1'>
<div className='Poliindex'>
<p>చిత్ర సీమ</p>
<Link to={'/చిత్ర సీమ'}>More</Link>
</div>
<div className='Polihome'>
{
cini.map(po=>(
<Ci id={po.id} title={po.title} stitle={po.subtitle} image={po.image} desc={po.desc} stamp={po.date} links={po.artlinks}/>
))
}
</div>
</div>
)
}
export default Cinema