Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

78 Zeilen
2.2 KiB

  1. import React from "react";
  2. // @material-ui/core components
  3. import { makeStyles } from "@material-ui/core/styles";
  4. // component
  5. import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/notificationsStyles.js";
  6. import Paper from '@material-ui/core/Paper';
  7. import Grid from '@material-ui/core/Grid';
  8. import GridContainer from "components/Grid/GridContainer.js";
  9. import Card from "components/Card/Card.js";
  10. import CardBody from "components/Card/CardBody.js";
  11. import Button from "components/CustomButtons/Button.js";
  12. import Paginations from "components/Pagination/Pagination.js";
  13. const useStyles = makeStyles(styles);
  14. const DataLatestNews = function ({ backend, news, ...props }) {
  15. const classes = useStyles();
  16. const latnews = news.map((data) => {
  17. return (
  18. <Card style={{width: "20rem"}}>
  19. <img
  20. style={{height: "180px", width: "100%", display: "block"}}
  21. className={classes.imgCardTop}
  22. src={`${backend}${data.img[0]["url"]}`}
  23. />
  24. <CardBody>
  25. {/* <h4 className={classes.cardTitle}>{data.title}</h4> */}
  26. <p>{data.title}</p>
  27. <Button color="info" onclick="myFunction()" id="myBtn">Read More</Button>
  28. </CardBody>
  29. </Card>
  30. );
  31. })
  32. return (
  33. <div className={classes.section} id="notifications">
  34. <div align="center">
  35. <h2>Latest News</h2>
  36. </div>
  37. <div>
  38. <GridContainer justify="center">
  39. <Grid align="center" style={{padding:"40px", marginTop:"-50px"}}>
  40. {latnews[0]}
  41. {latnews[1]}
  42. </Grid>
  43. <Grid align="center" style={{padding:"40px", marginTop:"-50px"}}>
  44. {latnews[2]}
  45. {latnews[3]}
  46. </Grid>
  47. <Grid align="center" style={{padding:"40px", marginTop:"-50px"}}>
  48. {latnews[4]}
  49. {latnews[5]}
  50. </Grid>
  51. </GridContainer>
  52. </div>
  53. <div align="center">
  54. <Paginations
  55. color="info"
  56. pages={[
  57. { text: 1 },
  58. { text: "..." },
  59. { text: 5 },
  60. { text: 6 },
  61. { active: true, text: 7 },
  62. { text: 8 },
  63. { text: 9 },
  64. { text: "..." },
  65. { text: 12 }
  66. ]}
  67. />
  68. </div>
  69. </div>
  70. );
  71. }
  72. export default DataLatestNews;