Archived
temporary
This commit is contained in:
+13
-13
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Wikipedia from './Wikipedia';
|
import Wikipedia from './Wikipedia';
|
||||||
import { Card, Tabs, Tab } from 'react-bootstrap';
|
import { Card, Tabs, Tab } from 'react-bootstrap';
|
||||||
import {Link} from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import Linkify from "react-linkify";
|
import Linkify from "react-linkify";
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
@@ -67,12 +67,12 @@ class VideoInfo extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// componentDidUpdate(prevProps, prevState, snapshot) {
|
// componentDidUpdate(prevProps, prevState, snapshot) {
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// shouldComponentUpdate(nextProps, nextState) {
|
// shouldComponentUpdate(nextProps, nextState) {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { error, isLoaded, VideoDetails, comments } = this.state;
|
const { error, isLoaded, VideoDetails, comments } = this.state;
|
||||||
const momentDuration = this.momentDuration;
|
const momentDuration = this.momentDuration;
|
||||||
@@ -80,7 +80,7 @@ class VideoInfo extends React.Component {
|
|||||||
if (error) {
|
if (error) {
|
||||||
return (
|
return (
|
||||||
<span className="text-white">
|
<span className="text-white">
|
||||||
<span>{}</span>
|
<span>{}</span>
|
||||||
Error: {error.message} -- Cannot get {error.config.url}
|
Error: {error.message} -- Cannot get {error.config.url}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
@@ -98,8 +98,8 @@ class VideoInfo extends React.Component {
|
|||||||
<b>Channel name: </b>{VideoDetails.snippet.channelTitle}<br />
|
<b>Channel name: </b>{VideoDetails.snippet.channelTitle}<br />
|
||||||
<b>Description: </b><Linkify>{VideoDetails.snippet.description}</Linkify><br />
|
<b>Description: </b><Linkify>{VideoDetails.snippet.description}</Linkify><br />
|
||||||
<b>Tags: </b>{VideoDetails.snippet.tags ?
|
<b>Tags: </b>{VideoDetails.snippet.tags ?
|
||||||
VideoDetails.snippet.tags.map((tag,i) =>
|
VideoDetails.snippet.tags.map((tag, i) =>
|
||||||
( <span key={i}><Link to={{pathname: '/search/' + tag}}>{tag}</Link>{" "}</span> ))
|
(<span key={i}><Link to={{ pathname: '/search/' + tag }}>{tag}</Link>{" "}</span>))
|
||||||
: ""}
|
: ""}
|
||||||
</p>
|
</p>
|
||||||
</Tab>
|
</Tab>
|
||||||
@@ -136,13 +136,13 @@ class VideoInfo extends React.Component {
|
|||||||
{/* Insert code here */}
|
{/* Insert code here */}
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab className="text-white" eventKey="wikipedia" title="Wikipedia">
|
<Tab className="text-white" eventKey="wikipedia" title="Wikipedia">
|
||||||
<Wikipedia
|
<Wikipedia
|
||||||
title={this.props.location.state.title}
|
title={'undefined' !== typeof this.props.location.state ? this.props.location.state.title : undefined}
|
||||||
title2={ytclear(this.state.VideoDetails.snippet.title).split('-')[1]}
|
title2={ytclear(this.state.VideoDetails.snippet.title).split('-')[1]}
|
||||||
artist={this.props.location.state.artist}
|
artist={'undefined' !== typeof this.props.location.state ? this.props.location.state.artist : undefined}
|
||||||
artist2={ytclear(this.state.VideoDetails.snippet.title).split('-')[0]}
|
artist2={ytclear(this.state.VideoDetails.snippet.title).split('-')[0]}
|
||||||
key={this.props.videoId}
|
key={this.props.videoId}
|
||||||
videoId={this.props.videoId}
|
videoId={this.props.videoId}
|
||||||
/>
|
/>
|
||||||
</Tab>
|
</Tab>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|||||||
@@ -40,6 +40,9 @@ class Wikipedia extends Component {
|
|||||||
wikidatakeys: Object.keys(wikidatatmp.claims),
|
wikidatakeys: Object.keys(wikidatatmp.claims),
|
||||||
isWDataLoaded: true
|
isWDataLoaded: true
|
||||||
});
|
});
|
||||||
|
wdk.getManyEntities(Object.keys(wikidatatmp.claims), 'en').then(
|
||||||
|
res=> console.info(res,'eee')
|
||||||
|
)
|
||||||
if (wikidatatmp.sitelinks.enwiki)
|
if (wikidatatmp.sitelinks.enwiki)
|
||||||
wikijs()
|
wikijs()
|
||||||
.page(wikidatatmp.sitelinks.enwiki.title)
|
.page(wikidatatmp.sitelinks.enwiki.title)
|
||||||
|
|||||||
Reference in New Issue
Block a user