generated from Arquisoft/viade_en3b
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3fd960
commit cd6e88f
Showing
9 changed files
with
612 additions
and
139 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React, { Component } from 'react'; | ||
import AwesomeSlider from 'react-awesome-slider'; | ||
import withAutoplay from 'react-awesome-slider/dist/autoplay'; | ||
import 'react-awesome-slider/dist/styles.css'; | ||
|
||
const AutoplaySlider = withAutoplay(AwesomeSlider); | ||
|
||
export class MyCarousel extends Component { | ||
|
||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
photos: this.props.photos, | ||
} | ||
|
||
this.media = []; | ||
this.state.photos.forEach((p) => { | ||
this.media.push({ source: p.getContent() }); | ||
}); | ||
} | ||
|
||
render() { | ||
|
||
return ( | ||
|
||
<AutoplaySlider | ||
play={true} | ||
cancelOnInteraction={false} | ||
interval={6000} | ||
media={this.media} | ||
/> | ||
); | ||
} | ||
} | ||
|
||
export default MyCarousel; |
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
Oops, something went wrong.