Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 

76 rader
2.9 KiB

  1. import React from 'react';
  2. import { Link as LinkScroll } from 'react-scroll'
  3. import Link from 'next/link';
  4. import dynamic from 'next/dynamic';
  5. const MainBanner = ({main_banner,news}) => {
  6. const Main_Banner = (main_banner && main_banner.length > 0)?(
  7. <div className="bigdata-analytics-banner" style={{
  8. 'backgroundImage' : (main_banner[0].attributes.Contents.data)?`url('/api/util?img=${encodeURIComponent(main_banner[0].attributes.Contents.data[0].attributes.Image.data.attributes.url)}')`:url('/images/bigdata-analytics/main-banner.jpg'),
  9. }}>
  10. <div className="bigdata-analytics-content" >
  11. <h1>{main_banner[0].attributes.Contents.data[0].attributes.Title}</h1>
  12. <p>{main_banner[0].attributes.Contents.data[0].attributes.Description}</p>
  13. <LinkScroll offset={-100} to="business_partner" spy={true} smooth={true}>
  14. <a className="btn btn-primary">Get Started</a>
  15. </LinkScroll>
  16. </div>
  17. </div>
  18. ):(
  19. <div className="bigdata-analytics-banner">
  20. <div className="bigdata-analytics-content" >
  21. <h1>Selamat Datang di Thamrin Group</h1>
  22. <p>Thamrin Group adalah perusahaan terkemuka di Sumatera Selatan & Bengkulu dengan fokus bisnis pada sektor otomotif dan properti.</p>
  23. <LinkScroll offset={-100} to="business_partner" spy={true} smooth={true}>
  24. <a className="btn btn-primary">Get Started</a>
  25. </LinkScroll>
  26. </div>
  27. </div>
  28. );
  29. const News = (news && news.length >0)?news[0].attributes.Contents.data.map((data)=>{
  30. return (
  31. <Link href={`/news/${data.id}`}>
  32. <div className="bigdata-analytics-banner" style={{
  33. 'backgroundImage' : (data.attributes.Image.data)?`url('/api/util?img=${encodeURIComponent(data.attributes.Image.data.attributes.url)}')`:url('/images/bigdata-analytics/main-banner.jpg'),
  34. }}>
  35. <div className="bigdata-analytics-content newsTitle" >
  36. <h1>{data.attributes.Title}</h1>
  37. </div>
  38. </div>
  39. </Link>
  40. );
  41. }):"";
  42. const OwlCarousel = dynamic(import('react-owl-carousel3'));
  43. const options = {
  44. center:false,
  45. loop: false,
  46. nav: false,
  47. dots: true,
  48. autoplay: true,
  49. smartSpeed: 1000,
  50. margin: 0,
  51. autoplayTimeout: 5000,
  52. autoWidth:false,
  53. responsive: {
  54. 0:{
  55. items: 1,
  56. },
  57. },
  58. }
  59. return (
  60. <div id="home">
  61. <OwlCarousel className="ml-projects-slides owl-carousel fullw owl-theme"
  62. {...options}>
  63. {Main_Banner}
  64. {News}
  65. </OwlCarousel>
  66. </div>
  67. )
  68. }
  69. export default MainBanner;