This repository has been archived by the owner on May 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from SoyBeansLab/fix/slider-props
Fix/slider props
- Loading branch information
Showing
2 changed files
with
51 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,36 @@ | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import Slider from "react-slick"; | ||
import SliderItem from "./SliderItem"; | ||
|
||
class HomeSlider extends React.Component { | ||
render() { | ||
var settings = { | ||
dots: true, | ||
infinite: true, | ||
speed: 500, | ||
slidesToShow: 1, | ||
slidesToScroll: 1, | ||
autoplay: true, | ||
arrow: true, | ||
}; | ||
export default function HomeSlider(props) { | ||
const settings = { | ||
dots: true, | ||
infinite: true, | ||
speed: 500, | ||
slidesToShow: 1, | ||
slidesToScroll: 1, | ||
autoplay: true, | ||
arrow: true, | ||
}; | ||
const slideItemList = props.slideItemList; | ||
|
||
return ( | ||
<Slider {...settings}> | ||
<div> | ||
return ( | ||
<Slider {...settings}> | ||
{slideItemList.map(row => ( | ||
<div key={row.contestTitle}> | ||
<SliderItem | ||
contestTitle="contestTitle-1" | ||
contestDate="2019.11.11" | ||
contestTime="16:00-17:00" | ||
contestContent="これはテストです" | ||
contestTitle={row.contestTitle} | ||
contestDate={row.contestDate} | ||
contestTime={row.contestTime} | ||
contestContent={row.contestContent} | ||
/> | ||
</div> | ||
<div> | ||
<SliderItem | ||
contestTitle="contestTitle-2" | ||
contestDate="2019.12.12" | ||
contestTime="16:00-17:00" | ||
contestContent="これはテストです" | ||
/> | ||
</div> | ||
<div> | ||
<SliderItem | ||
contestTitle="contestTitle-3" | ||
contestDate="2019.01.01" | ||
contestTime="16:00-19:00" | ||
contestContent="text is text" | ||
/> | ||
</div> | ||
</Slider> | ||
); | ||
} | ||
))} | ||
</Slider> | ||
); | ||
} | ||
|
||
export default HomeSlider; | ||
HomeSlider.propTypes = { | ||
slideItemList: PropTypes.array, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters