use eslint to lint project
drop code quality job
This commit is contained in:
@ -13,22 +13,20 @@ import {Button} from '../../elements/GPElements/Button';
|
||||
import {ActorTypes, VideoTypes} from '../../types/ApiTypes';
|
||||
|
||||
interface state {
|
||||
data: VideoTypes.VideoUnloadedType[],
|
||||
actor: ActorType
|
||||
data: VideoTypes.VideoUnloadedType[];
|
||||
actor: ActorType;
|
||||
}
|
||||
|
||||
/**
|
||||
* empty default props with id in url
|
||||
*/
|
||||
interface props extends RouteComponentProps<{ id: string }> {
|
||||
}
|
||||
|
||||
interface Props extends RouteComponentProps<{id: string}> {}
|
||||
|
||||
/**
|
||||
* info page about a specific actor and a list of all its videos
|
||||
*/
|
||||
export class ActorPage extends React.Component<props, state> {
|
||||
constructor(props: props) {
|
||||
export class ActorPage extends React.Component<Props, state> {
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
|
||||
this.state = {data: [], actor: {ActorId: 0, Name: '', Thumbnail: ''}};
|
||||
@ -40,20 +38,17 @@ export class ActorPage extends React.Component<props, state> {
|
||||
<PageTitle title={this.state.actor.Name} subtitle={this.state.data ? this.state.data.length + ' videos' : null}>
|
||||
<span className={style.overviewbutton}>
|
||||
<Link to='/actors'>
|
||||
<Button onClick={(): void => {}} title='Go to Actor overview'/>
|
||||
<Button onClick={(): void => {}} title='Go to Actor overview' />
|
||||
</Link>
|
||||
</span>
|
||||
</PageTitle>
|
||||
<SideBar>
|
||||
<div className={style.pic}>
|
||||
<FontAwesomeIcon style={{color: 'white'}} icon={faUser} size='10x'/>
|
||||
<FontAwesomeIcon style={{color: 'white'}} icon={faUser} size='10x' />
|
||||
</div>
|
||||
<SideBarTitle>Attention: This is an early preview!</SideBarTitle>
|
||||
</SideBar>
|
||||
{this.state.data.length !== 0 ?
|
||||
<VideoContainer
|
||||
data={this.state.data}/> :
|
||||
<div>No Data found!</div>}
|
||||
{this.state.data.length !== 0 ? <VideoContainer data={this.state.data} /> : <div>No Data found!</div>}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@ -66,15 +61,19 @@ export class ActorPage extends React.Component<props, state> {
|
||||
* request more actor info from backend
|
||||
*/
|
||||
getActorInfo(): void {
|
||||
callAPI(APINode.Actor, {
|
||||
action: 'getActorInfo',
|
||||
ActorId: parseInt(this.props.match.params.id)
|
||||
}, (result: ActorTypes.videofetchresult) => {
|
||||
this.setState({
|
||||
data: result.Videos ? result.Videos : [],
|
||||
actor: result.Info
|
||||
});
|
||||
});
|
||||
callAPI(
|
||||
APINode.Actor,
|
||||
{
|
||||
action: 'getActorInfo',
|
||||
ActorId: parseInt(this.props.match.params.id, 10)
|
||||
},
|
||||
(result: ActorTypes.videofetchresult) => {
|
||||
this.setState({
|
||||
data: result.Videos ? result.Videos : [],
|
||||
actor: result.Info
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user