File tree Expand file tree Collapse file tree
src/client/components/Collections Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ export default class CollectionList extends Component {
2828 this . state = {
2929 checkedTweets : [ ] ,
3030 findUser : '' ,
31- findingUser : false
31+ findingUser : false ,
32+ lastUserLookup : ''
3233 }
3334 this . randomTweet = Math . floor ( Math . random ( ) * ( 98 ) )
3435 }
@@ -69,7 +70,8 @@ export default class CollectionList extends Component {
6970 findUser ( ) {
7071 if ( this . state . findUser !== '' ) {
7172 this . setState ( {
72- findingUser : true
73+ findingUser : true ,
74+ lastUserLookup : this . state . findUser
7375 } )
7476 this . props . getTweetsForUser ( this . props . searchId , this . state . findUser )
7577 }
@@ -155,21 +157,13 @@ export default class CollectionList extends Component {
155157
156158 if ( this . state . findingUser ) {
157159 if ( this . props . foundUserTweets > 0 ) {
158- usersInfo = ( < div className = { style . FoundUser } >
159- < div > { this . props . search . users . filter ( u => u . screenName === this . state . findUser ) . map ( ( u , i ) => {
160- return < img className = { style . UserImg }
161- src = { u . avatarUrl }
162- alt = { u . screenName }
163- title = { u . screenName } key = { `u${ i } ` } />
164- } ) }
165- < br /> < a href = { `https://twitter.com/${ this . state . findUser } ` } > @{ this . state . findUser } </ a >
166- </ div >
160+ usersInfo = (
167161 < Typography variant = "body2" >
168- Found { this . props . foundUserTweets } tweet{ this . props . foundUserTweets > 1 ? 's' : '' } by this user.
169- </ Typography >
170- </ div > )
162+ Found { this . props . foundUserTweets } tweet{ this . props . foundUserTweets > 1 ? 's' : '' } by
163+ < a href = { `https://twitter.com/ ${ this . state . lastUserLookup } ` } > @ { this . state . lastUserLookup } </ a > .
164+ </ Typography > )
171165 } else {
172- usersInfo = < Typography variant = "body2" > Could not find user "{ this . state . findUser } ".</ Typography >
166+ usersInfo = < Typography variant = "body2" > Could not find user "{ this . state . lastUserLookup } ".</ Typography >
173167 }
174168 }
175169
You can’t perform that action at this time.
0 commit comments