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