Archived
non mi ricordo cosa ho fatto
This commit is contained in:
Generated
+4
-2
@@ -5854,7 +5854,8 @@
|
|||||||
},
|
},
|
||||||
"safe-buffer": {
|
"safe-buffer": {
|
||||||
"version": "5.1.1",
|
"version": "5.1.1",
|
||||||
"bundled": true
|
"bundled": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"safer-buffer": {
|
"safer-buffer": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
@@ -5946,7 +5947,8 @@
|
|||||||
},
|
},
|
||||||
"yallist": {
|
"yallist": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
"bundled": true
|
"bundled": true,
|
||||||
|
"optional": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
+2
-2
@@ -44,7 +44,7 @@ class TopBar extends Component {
|
|||||||
<Nav className="mr-auto">
|
<Nav className="mr-auto">
|
||||||
<Link to="/" className="text-light nav-link">Home</Link>
|
<Link to="/" className="text-light nav-link">Home</Link>
|
||||||
<Link to="/link" className="text-light nav-link">link</Link>
|
<Link to="/link" className="text-light nav-link">link</Link>
|
||||||
<NavDropdown title="arnaldo" id="basic-nav-dropdown" >
|
{/* <NavDropdown title="arnaldo" id="basic-nav-dropdown" >
|
||||||
<NavDropdown.Item href="#action/3.1">Action</NavDropdown.Item>
|
<NavDropdown.Item href="#action/3.1">Action</NavDropdown.Item>
|
||||||
<NavDropdown.Item href="#action/3.2">
|
<NavDropdown.Item href="#action/3.2">
|
||||||
Another action
|
Another action
|
||||||
@@ -56,7 +56,7 @@ class TopBar extends Component {
|
|||||||
<NavDropdown.Item href="#action/3.4">
|
<NavDropdown.Item href="#action/3.4">
|
||||||
Separated link
|
Separated link
|
||||||
</NavDropdown.Item>
|
</NavDropdown.Item>
|
||||||
</NavDropdown>
|
</NavDropdown> */}
|
||||||
</Nav>
|
</Nav>
|
||||||
<form className="form-inline" onSubmit={this.handleSubmit}>
|
<form className="form-inline" onSubmit={this.handleSubmit}>
|
||||||
<FormControl
|
<FormControl
|
||||||
|
|||||||
+13
-13
@@ -1,10 +1,10 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
// import PropTypes from 'prop-types';
|
// import PropTypes from 'prop-types';
|
||||||
import Wikipedia from './areainfo/Wikipedia';
|
import Wikipedia from './areainfo/Wikipedia';
|
||||||
import { Col, Tabs, Tab } from 'react-bootstrap';
|
import { Col, Tabs, Tab } from 'react-bootstrap';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
class VideoInfo extends Component {
|
class VideoInfo extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state={
|
this.state={
|
||||||
@@ -89,15 +89,15 @@ class VideoInfo extends Component {
|
|||||||
{/* codice per tabs reccomenders */}
|
{/* codice per tabs reccomenders */}
|
||||||
<Tabs defaultActiveKey="a" id="uncontrolled-tab-example">
|
<Tabs defaultActiveKey="a" id="uncontrolled-tab-example">
|
||||||
<Tab eventKey="a" title="A">
|
<Tab eventKey="a" title="A">
|
||||||
<Wikipedia query={ VideoDetails.snippet.title } />
|
<Wikipedia query={ this.props.location.state ? this.props.location.state.title : VideoDetails.snippet.title } />
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab eventKey="b" title="B">
|
<Tab eventKey="b" title="B">
|
||||||
<p>B</p>
|
<p>{}</p>
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab eventKey="c" title="C">
|
<Tab eventKey="c" title="C">
|
||||||
<p>C</p>
|
<p>C</p>
|
||||||
</Tab>
|
</Tab>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</Col>
|
</Col>
|
||||||
<Col className='border border-dark' lg={{span:4, offset:1}}>
|
<Col className='border border-dark' lg={{span:4, offset:1}}>
|
||||||
<p>2</p>
|
<p>2</p>
|
||||||
@@ -106,10 +106,10 @@ class VideoInfo extends Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoInfo.propTypes = {
|
VideoInfo.propTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default VideoInfo;
|
export default VideoInfo;
|
||||||
+8
-1
@@ -125,13 +125,20 @@ class VideoList extends React.Component {
|
|||||||
{items.map(item => (
|
{items.map(item => (
|
||||||
<Col key={item.videoID} lg={{ span: 3 }} md="6">
|
<Col key={item.videoID} lg={{ span: 3 }} md="6">
|
||||||
<Card className="my-1 carta">
|
<Card className="my-1 carta">
|
||||||
<Link to={{ pathname: '/video/' + item.videoID }}>
|
<Link to={{
|
||||||
|
pathname: '/video/' + item.videoID,
|
||||||
|
state: {
|
||||||
|
artist: item.artist,
|
||||||
|
title: item.title +' '+ item.artist
|
||||||
|
}
|
||||||
|
}}>
|
||||||
{/* {item.artist} - {item.title} {item.videoID} {item.category} */}
|
{/* {item.artist} - {item.title} {item.videoID} {item.category} */}
|
||||||
<Card.Img src={item.thumbnail} alt={'Thumbnail of '+item.title } />
|
<Card.Img src={item.thumbnail} alt={'Thumbnail of '+item.title } />
|
||||||
<Card.ImgOverlay>
|
<Card.ImgOverlay>
|
||||||
<Card.Title className="bg-dark d-inline text-white">
|
<Card.Title className="bg-dark d-inline text-white">
|
||||||
{item.artist} - {item.title}
|
{item.artist} - {item.title}
|
||||||
</Card.Title>
|
</Card.Title>
|
||||||
|
<p className='d-table d-lg-none card-text bg-dark text-white'>{item.category}</p>
|
||||||
</Card.ImgOverlay>
|
</Card.ImgOverlay>
|
||||||
</Link>
|
</Link>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
+2
-2
@@ -27,7 +27,7 @@ class VideoPlayer extends Component {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount(){
|
componentWillMount(){
|
||||||
if(this.props.match.params.id)
|
if(this.props.match.params.id)
|
||||||
this.setState((state, props) => { return { videoId: props.match.params.id }});
|
this.setState((state, props) => { return { videoId: props.match.params.id }});
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ class VideoPlayer extends Component {
|
|||||||
// console.warn(event.target.getDuration());
|
// console.warn(event.target.getDuration());
|
||||||
}
|
}
|
||||||
_onStateChange(event) {
|
_onStateChange(event) {
|
||||||
// console.info('statechange: ', event)
|
// console.info('statechange: ', event.data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,29 +12,36 @@ class Wikipedia extends Component {
|
|||||||
isLoaded: false
|
isLoaded: false
|
||||||
};
|
};
|
||||||
this.getWikiBox = this.getWikiBox.bind(this);
|
this.getWikiBox = this.getWikiBox.bind(this);
|
||||||
|
this.raffina = this.raffina.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
getWikiBox(name){
|
getWikiBox(name){
|
||||||
wikijs()
|
wikijs()
|
||||||
.page(name)
|
.page(name)
|
||||||
.then(page => page.fullInfo())
|
.then(page => page.fullInfo())
|
||||||
.then(infobox => console.log(infobox)
|
.then(infobox => console.log('infobox', infobox)
|
||||||
//this.setState({ infobox })
|
//this.setState({ infobox })
|
||||||
);
|
);
|
||||||
//console.log('infobox', this.state.infobox)
|
//console.log('infobox', this.state.infobox)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
raffina(results){
|
||||||
|
console.log('raffina',results);
|
||||||
|
return results[0];
|
||||||
|
}
|
||||||
|
|
||||||
// componentWillMount() {
|
// componentWillMount() {
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
componentDidMount() {
|
componentWillMount() {
|
||||||
wikijs().search(this.props.query).then(data => {
|
wikijs().find(this.props.query, this.raffina).then(data => {
|
||||||
this.setState({
|
this.setState({
|
||||||
data,
|
data,
|
||||||
isLoaded: true
|
isLoaded: true
|
||||||
});
|
});
|
||||||
console.log(data);
|
console.log(data.html());
|
||||||
|
//this.getWikiBox(data.results[0]);
|
||||||
}, error => {
|
}, error => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
this.setState({
|
this.setState({
|
||||||
@@ -77,7 +84,7 @@ this.getWikiBox = this.getWikiBox.bind(this);
|
|||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<p>risultato ricerca wikipedia: { data.results[0] }</p>
|
{/* <p>risultato ricerca wikipedia: { data.results[0] }</p> */}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user