scroll lista iniziale, link react readme, minor changes

This commit is contained in:
matteo
2018-11-21 21:14:52 +01:00
parent 1a1ba9756f
commit 403cbc013d
6 changed files with 30 additions and 14 deletions
+6
View File
@@ -234,6 +234,12 @@ Il css di bootstrap va importato una volta sola nel componente che racchiude tut
- [Bootstrap 4.1 css classes](https://hackerthemes.com/bootstrap-cheatsheet) - [Bootstrap 4.1 css classes](https://hackerthemes.com/bootstrap-cheatsheet)
- [Bootstrap 4.1 site](https://getbootstrap.com/docs/4.1) - [Bootstrap 4.1 site](https://getbootstrap.com/docs/4.1)
- [ReactBootstrap reference](https://react-bootstrap.netlify.com/getting-started/introduction/) - [ReactBootstrap reference](https://react-bootstrap.netlify.com/getting-started/introduction/)
- [awesome-react-bootstrap](https://github.com/Hermanya/awesome-react-bootstrap-components/blob/master/readme.md)
## React stuff
[awesome-react](https://github.com/enaqx/awesome-react) --> lista di link su react.
## YouTube video player ## YouTube video player
+6
View File
@@ -1,3 +1,9 @@
.bg-black{ .bg-black{
background-color:#000000; background-color:#000000;
}
.scrollable{
overflow: auto !important;
height: 40vh;
margin-top: 2vh;
} }
+3 -1
View File
@@ -12,7 +12,9 @@ class App extends React.Component {
render() { render() {
return ( return (
<React.Fragment> <React.Fragment>
<Row>
<TopBar /> <TopBar />
</Row>
<Row className="justify-content-center bg-black"> <Row className="justify-content-center bg-black">
<Col xs="12" sm="6"> <Col xs="12" sm="6">
<Switch> <Switch>
@@ -22,7 +24,7 @@ class App extends React.Component {
</Switch> </Switch>
</Col> </Col>
</Row> </Row>
<Row> <Row className='scrollable'>
<Switch> <Switch>
<Route path="/video/:id" component={VideoInfo} /> <Route path="/video/:id" component={VideoInfo} />
<Route exact path='/' component={VideoList} /> <Route exact path='/' component={VideoList} />
+2 -3
View File
@@ -1,6 +1,5 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { import {
Row,
Navbar, Navbar,
Nav, Nav,
NavDropdown, NavDropdown,
@@ -35,7 +34,7 @@ class TopBar extends Component {
} }
render() { render() {
return ( return (
<Row> <React.Fragment>
<Navbar bg="dark" className="py-0 px-1 w-100" expand="md"> <Navbar bg="dark" className="py-0 px-1 w-100" expand="md">
<Navbar.Brand> <Navbar.Brand>
<Link to="/">HazeTV</Link> <Link to="/">HazeTV</Link>
@@ -70,7 +69,7 @@ class TopBar extends Component {
</form> </form>
</Navbar.Collapse> </Navbar.Collapse>
</Navbar> </Navbar>
</Row> </React.Fragment>
); );
} }
} }
-7
View File
@@ -50,13 +50,6 @@ class VideoList extends React.Component {
} else { } else {
return ( return (
<React.Fragment> <React.Fragment>
<Col className="my-2" xs="12" sm="12">
<code>
Url loaded: <span className="bg-dark">{headers.url}</span>
</code>
<br />
<code>Total videos: {items.length}</code>
</Col>
{items.map(item => ( {items.map(item => (
<Col key={item.videoID} lg="4" md="6"> <Col key={item.videoID} lg="4" md="6">
<Card className="my-1"> <Card className="my-1">
+13 -3
View File
@@ -6,12 +6,22 @@ class Wikipedia extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
data : {}, data: {},
infobox: {},
error: null, error: null,
isLoaded: false isLoaded: false
}; };
this.getWikiBox = this.getWikiBox.bind(this);
}
getWikiBox(name){
wikijs()
.page(name)
.then(page => page.fullInfo())
.then(infobox => console.log(infobox)
//this.setState({ infobox })
);
//console.log('infobox', this.state.infobox)
} }
// componentWillMount() { // componentWillMount() {
@@ -19,7 +29,7 @@ class Wikipedia extends Component {
// } // }
componentDidMount() { componentDidMount() {
wikijs().search(this.props.query,1).then(data => { wikijs().search(this.props.query).then(data => {
this.setState({ this.setState({
data, data,
isLoaded: true isLoaded: true