This repository was archived by the owner on Jun 28, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
src/components/SearchAutocomplete Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const client = new ApiClient();
88const styles = require ( './style.scss' ) ;
99
1010@connect (
11- ( state , ownProps ) => {
11+ state => {
1212 const surahs = state . surahs . entities ;
1313 const surahId = state . surahs . current ;
1414 let lang = 'en' ;
@@ -30,9 +30,8 @@ const styles = require('./style.scss');
3030 surahs,
3131 lang
3232 } ;
33- } , {
34- push
35- }
33+ } ,
34+ { push }
3635)
3736export default class SearchAutocomplete extends Component {
3837 constructor ( ) {
@@ -107,7 +106,7 @@ export default class SearchAutocomplete extends Component {
107106 if ( this . cached [ lang ] [ value ] ) {
108107 this . setState ( { ayat : this . cached [ lang ] [ value ] } ) ;
109108 } else {
110- client . get ( '/suggest' , { params : { q : value , l :lang } } ) . then ( ( res ) => {
109+ client . get ( '/v2/ suggest' , { params : { q : value , l : lang } } ) . then ( ( res ) => {
111110 this . cached [ lang ] [ value ] = res ;
112111
113112 if ( this . props . value . trim ( ) === value ) {
@@ -181,7 +180,6 @@ export default class SearchAutocomplete extends Component {
181180 }
182181
183182 renderList ( key ) {
184- //this.handleItemKeyDown.bind({ item, self: this })
185183 return this . state [ key ] . map ( ( item ) => (
186184 < li key = { item . href } tabIndex = "0" onKeyDown = { ( ( event ) => { this . handleItemKeyDown . call ( this , event , item ) ; } ) . bind ( this ) } >
187185 < div className = { styles . link } >
You can’t perform that action at this time.
0 commit comments