-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sports.js
46 lines (41 loc) · 1.18 KB
/
Sports.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
46
import React, { useEffect, useState } from 'react'
import { Link } from 'react-router-dom'
import db from './firebase';
import So from './home pages/So';
function Sports() {
const [spo, setspo] = useState([])
useEffect(()=>{
getpns();
},[]);
function getpns(){
db.collection('Sports').orderBy('date','desc').limit(3).onSnapshot(function(querySnapshot){
setspo(
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'>
{
spo.map(po=>(
<So id={po.id} title={po.title} image={po.image} desc={po.desc} stamp={po.date} links={po.artlinks} stitle={po.subtitle}/>
))
}
</div>
</div>
)
}
export default Sports