No tomaba en cuenta pagina de inicio
This commit is contained in:
@@ -55,7 +55,7 @@ class SearchSong extends React.Component {
|
||||
return (
|
||||
<li className='song'>
|
||||
<Link to={`/song/${song.id}`}>
|
||||
<div class='description'>
|
||||
<div className='description'>
|
||||
<span>{song.title}</span>
|
||||
<span className='small'>{song.artist[0].name}</span>
|
||||
</div>
|
||||
@@ -68,7 +68,7 @@ class SearchSong extends React.Component {
|
||||
class SearchSongs extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {songs: null, paginate: null, page: 1}
|
||||
this.state = {songs: null, paginate: null, page: this.props.page ? this.props.page : 1}
|
||||
}
|
||||
|
||||
componentDidMount = _ => this.loadSongs(this.props.query, this.state.page);
|
||||
@@ -143,7 +143,7 @@ class SearchDisc extends React.Component {
|
||||
<li className='disc'>
|
||||
<Link to={`/disc/${disc.id}`}>
|
||||
<CoverArt cover_art={disc.cover_art} alt={`Cover del disco: ${disc.title}`}/>
|
||||
<div class='description'>
|
||||
<div className='description'>
|
||||
<span>{disc.title} {disc.date && this.getReleaseYear(disc.date)}</span>
|
||||
<span className='small'>{disc.artist[0].name}</span>
|
||||
</div>
|
||||
@@ -156,7 +156,7 @@ class SearchDisc extends React.Component {
|
||||
class SearchDiscs extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {discs: null, paginate: null, page: 1}
|
||||
this.state = {discs: null, paginate: null, page: this.props.page ? this.props.page : 1}
|
||||
}
|
||||
|
||||
componentDidMount = _ => this.loadDiscs(this.props.query, this.state.page);
|
||||
@@ -236,7 +236,7 @@ class SearchArtist extends React.Component {
|
||||
class SearchArtists extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {artists: null, paginate: null, page: 1}
|
||||
this.state = {artists: null, paginate: null, page: this.props.page ? this.props.page : 1}
|
||||
}
|
||||
|
||||
componentDidMount = _ => this.loadArtists(this.props.query, this.state.page);
|
||||
@@ -333,9 +333,9 @@ class SearchTabs extends React.Component {
|
||||
<Tab className='tab' selectedClassName='selected'>Discos</Tab>
|
||||
<Tab className='tab' selectedClassName='selected'>Canciones</Tab>
|
||||
</TabList>
|
||||
<TabPanel><SearchArtists query={this.props.query} onPageChange={this.handlePageChange('artist')}/></TabPanel>
|
||||
<TabPanel><SearchDiscs query={this.props.query} onPageChange={this.handlePageChange('disc')}/></TabPanel>
|
||||
<TabPanel><SearchSongs query={this.props.query} onPageChange={this.handlePageChange('song')}/></TabPanel>
|
||||
<TabPanel><SearchArtists query={this.props.query} page={this.props.page} onPageChange={this.handlePageChange('artist')}/></TabPanel>
|
||||
<TabPanel><SearchDiscs query={this.props.query} page={this.props.page} onPageChange={this.handlePageChange('disc')}/></TabPanel>
|
||||
<TabPanel><SearchSongs query={this.props.query} page={this.props.page} onPageChange={this.handlePageChange('song')}/></TabPanel>
|
||||
</Tabs>
|
||||
)
|
||||
}
|
||||
@@ -350,6 +350,8 @@ export class Search extends React.Component {
|
||||
query: parsed.query,
|
||||
page: !isNaN(+parsed.page) ? +parsed.page : 1,
|
||||
};
|
||||
|
||||
console.log(this.state);
|
||||
}
|
||||
|
||||
navigateToState = () => {
|
||||
|
||||
Reference in New Issue
Block a user