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
ikit
committed
Nov 8, 2018
1 parent
9c6e9c0
commit b16930b
Showing
12 changed files
with
22,763 additions
and
940 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
formations/ReacJs by Kumquats/1.1-ui-framework/demarrage/.babelrc
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,3 @@ | ||
{ | ||
"presets": ["@babel/env"] | ||
} |
21,571 changes: 21,571 additions & 0 deletions
21,571
...ations/ReacJs by Kumquats/3.1-react-youtube-bootstrap/demarrage/site/web/js/app.bundle.js
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
formations/ReacJs by Kumquats/3.1-react-youtube-bootstrap/demarrage/src/.babelrc
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,3 +1,3 @@ | ||
{ | ||
"presets": ["@babel/preset-env"] | ||
"presets": ["@babel/preset-env", "@babel/preset-react"] | ||
} |
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
45 changes: 45 additions & 0 deletions
45
formations/ReacJs by Kumquats/3.1-react-youtube-bootstrap/demarrage/src/js/VideoDetail.js
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,45 @@ | ||
import React from 'react'; | ||
import videos from './videos'; | ||
|
||
class VideoDetail extends React.Component { | ||
constructor(...args) { | ||
super(...args); | ||
this.state = { | ||
video: videos[ 0 ] | ||
} | ||
} | ||
|
||
render() { | ||
return ( | ||
<div className="row marketing"> | ||
<div className="col-sm-12 col-md-12"> | ||
<div className="video-detail"> | ||
<div className="caption"> | ||
<video | ||
style={{ width: '100%', backgroundColor: 'black'}} | ||
height="300" | ||
controls | ||
src={this.state.video.file} | ||
> | ||
</video> | ||
<h3>{this.state.video.title}</h3> | ||
{ | ||
this.state.video.description && | ||
<p>{this.state.video.description}</p> | ||
} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
componentDidMount() { | ||
setInterval( () => { | ||
const index = videos.findIndex( video => this.state.video.id == video.id ); | ||
this.setState( { video: videos[ index + 1 == videos.length ? 0 : ( index + 1 ) ] } ); | ||
}, 2000 ); | ||
} | ||
} | ||
|
||
export default VideoDetail; |
56 changes: 56 additions & 0 deletions
56
formations/ReacJs by Kumquats/3.1-react-youtube-bootstrap/demarrage/src/js/VideoList.js
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,56 @@ | ||
import React from 'react'; | ||
import videos from './videos'; | ||
|
||
class VideoList extends React.Component { | ||
constructor(...args) { | ||
super(...args); | ||
this.state = { | ||
videos: videos | ||
} | ||
} | ||
|
||
render() { | ||
return ( | ||
<div className="row marketing"> | ||
<div className="col-lg-12"> | ||
<ul className="media-list"> | ||
{this.state.videos.map( video => ( | ||
<li className="media"> | ||
<div className="media-left"> | ||
<img className="media-object" | ||
alt="cat" src={video.thumbnail} | ||
width="246" | ||
height="138" /> | ||
</div> | ||
<div className="media-body"> | ||
<h4 className="media-heading">{video.title}</h4> | ||
<p>{video.description}</p> | ||
</div> | ||
</li> | ||
) )} | ||
</ul> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
componentDidMount() { | ||
setInterval( () => { | ||
const index = this.state.videos.length + 1; | ||
this.setState( { | ||
videos: [ | ||
{ | ||
id: index, | ||
title: 'Ma vidéo ' + index, | ||
description: 'Ceci est une super vidéo', | ||
file: `uploads/video${index}.mp4`, | ||
thumbnail: `uploads/thumbnails/video${index}.jpg`, | ||
}, | ||
...this.state.videos | ||
] | ||
} ) | ||
}, 5000 ); | ||
} | ||
} | ||
|
||
export default VideoList; |
10 changes: 8 additions & 2 deletions
10
formations/ReacJs by Kumquats/3.1-react-youtube-bootstrap/demarrage/src/js/app.js
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,3 +1,9 @@ | ||
import helloWorld from './helloWorld'; | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import VideoDetail from './VideoDetail'; | ||
import VideoList from './VideoList'; | ||
|
||
helloWorld(); | ||
ReactDOM.render( | ||
<VideoList />, | ||
document.querySelector( '#appContainer' ) | ||
); |
4 changes: 0 additions & 4 deletions
4
formations/ReacJs by Kumquats/3.1-react-youtube-bootstrap/demarrage/src/js/helloWorld.js
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
formations/ReacJs by Kumquats/3.1-react-youtube-bootstrap/demarrage/src/js/videos.js
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,23 @@ | ||
export default [ | ||
{ | ||
id: 1, | ||
title: 'Ma vidéo 1', | ||
description: 'Ceci est une super vidéo', | ||
file: 'uploads/video1.mp4', | ||
thumbnail: 'uploads/thumbnails/video1.jpg' | ||
}, | ||
{ | ||
id: 2, | ||
title: 'Ma vidéo 2', | ||
description: 'Ceci est une super vidéo', | ||
file: 'uploads/video2.mp4', | ||
thumbnail: 'uploads/thumbnails/video2.jpg' | ||
}, | ||
{ | ||
id: 3, | ||
title: 'Ma vidéo 3', | ||
description: 'Ceci est une super vidéo', | ||
file: 'uploads/video3.mp4', | ||
thumbnail: 'uploads/thumbnails/video3.jpg' | ||
} | ||
] |
Oops, something went wrong.