Browse Source

feature(contacts): when searching a contact yeilds no results and we recognize an @ and 66 len pubkey we will populate the contact manual form with the search

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
4fecb240bb
  1. 14
      app/components/Contacts/ContactsForm.js
  2. 4
      app/components/Contacts/ContactsForm.scss
  3. 1
      app/components/Nav/Nav.scss

14
app/components/Contacts/ContactsForm.js

@ -102,7 +102,7 @@ class ContactsForm extends React.Component {
updateManualFormSearchQuery('')
return
}
// clear any existing errors
// clear any existing errors
updateManualFormErrors({ manualInput: null })
const [pubkey, host] = contactsform.manualSearchQuery && contactsform.manualSearchQuery.split('@')
@ -112,6 +112,16 @@ class ContactsForm extends React.Component {
updateManualFormSearchQuery('')
}
const searchUpdated = (search) => {
updateContactFormSearchQuery(search)
console.log('search: ', search)
if (search.includes('@') && search.split('@')[0].length === 66) {
console.log('yo')
updateManualFormSearchQuery(search)
}
}
return (
<div>
<ReactModal
@ -139,7 +149,7 @@ class ContactsForm extends React.Component {
placeholder='Find contact by alias or pubkey'
className={styles.searchInput}
value={contactsform.searchQuery}
onChange={event => updateContactFormSearchQuery(event.target.value)}
onChange={event => searchUpdated(event.target.value)}
/>
</div>

4
app/components/Contacts/ContactsForm.scss

@ -49,7 +49,7 @@
.networkResults {
overflow-y: scroll;
height: 300px;
height: 250px;
margin-top: 30px;
padding: 20px 0;
@ -156,7 +156,7 @@
.manualFormSpinner {
position: absolute;
right: 0;
top: 50%;
top: 40%;
padding: 0 10px;
}
}

1
app/components/Nav/Nav.scss

@ -158,7 +158,6 @@
span {
margin-left: 15px;
line-height: 22px;
// font-size: 20px;
font-size: 18px;
font-weight: 500;
letter-spacing: .2px;

Loading…
Cancel
Save