Archived
manca una settimana
This commit is contained in:
+1
-2
@@ -6,7 +6,7 @@ import axios from 'axios';
|
||||
import Linkify from "react-linkify";
|
||||
import Card from "react-bootstrap/lib/Card";
|
||||
import moment from 'moment';
|
||||
import momentDurationFormat from 'moment-duration-format';
|
||||
import momentDurationFormat from 'moment-duration-format'; //eslint-disable-line no-unused-vars
|
||||
import './css/VideoInfo.scss';
|
||||
|
||||
|
||||
@@ -59,7 +59,6 @@ class VideoInfo extends React.Component {
|
||||
fmt: "json",
|
||||
limit: 1,
|
||||
inc: "aliases"
|
||||
|
||||
}})
|
||||
])
|
||||
.then(axios.spread((response1, response2) => {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Row, Col, Button, Collapse } from 'react-bootstrap';
|
||||
import { Switch, Route } from 'react-router';
|
||||
import Random from '../reccomenders/Random';
|
||||
import Related from '../reccomenders/Related';
|
||||
import Search from '../reccomenders/Search';
|
||||
import fvitali from '../reccomenders/fvitali';
|
||||
|
||||
// and so on..
|
||||
|
||||
@@ -31,21 +31,11 @@ class Suggestion extends Component {
|
||||
// }
|
||||
|
||||
render() {
|
||||
let a =['','','','','','','','','','',''];
|
||||
return (
|
||||
<React.Fragment>
|
||||
{/* <Col xs="10">
|
||||
<Row>
|
||||
{a.map((x,i) => <Col xs={{'span': 10, 'offset': 1}} className="mt-1 border border-danger">- video {i}</Col>)}
|
||||
</Row>
|
||||
</Col>
|
||||
<Col className="mt-1 mr-2 border border-danger">
|
||||
{a.map((x,i) => i)}
|
||||
?? box utile o superfluo?
|
||||
</Col> */}
|
||||
<Col xs="10">
|
||||
<Switch>
|
||||
|
||||
<Route path='/video/:id/vitali' component={fvitali} />
|
||||
<Route path='/search/:query' component={Search} />
|
||||
<Route path='/video/:id/random' component={Random} />
|
||||
{/* lasciare questo per ultimo */}
|
||||
|
||||
+20
-17
@@ -15,7 +15,25 @@ class Search extends React.Component {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.youtubeSearch();
|
||||
axios.get('https://www.googleapis.com/youtube/v3/search', { //Richiesta per ottenere i commenti del video
|
||||
params: {
|
||||
'part': 'snippet',
|
||||
'q': this.state.query,
|
||||
'videoEmbeddable': 'true',
|
||||
'type': 'video',
|
||||
'maxResults': 30,
|
||||
'topicId': '/m/04rlf, /m/02jjt',
|
||||
'key': 'AIzaSyA21Odw9UdfiOJnxvA_eDfOW0OxuUfHKig' // process.env.APIKEY in production
|
||||
}
|
||||
}).then(
|
||||
res => {
|
||||
console.log(res.data);
|
||||
this.setState({
|
||||
res: res.data
|
||||
})
|
||||
},
|
||||
error => {console.error(error)}
|
||||
)
|
||||
}
|
||||
|
||||
// shouldComponentUpdate(nextProps, nextState) {
|
||||
@@ -31,22 +49,7 @@ class Search extends React.Component {
|
||||
// }
|
||||
|
||||
youtubeSearch() {
|
||||
axios.get('https://www.googleapis.com/youtube/v3/search', { //Richiesta per ottenere i commenti del video
|
||||
params: {
|
||||
'part': 'snippet',
|
||||
'q': this.state.query,
|
||||
'videoEmbeddable': 'true',
|
||||
'type': 'video',
|
||||
'maxResults': 30,
|
||||
'topicId': '/m/04rlf, /m/02jjt',
|
||||
'key': 'AIzaSyA21Odw9UdfiOJnxvA_eDfOW0OxuUfHKig' // process.env.APIKEY in production
|
||||
}
|
||||
}).then(
|
||||
res => {
|
||||
console.log(res.data)
|
||||
},
|
||||
error => {console.error(error)}
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
Reference in New Issue
Block a user