|
|
@ -5,6 +5,7 @@ import { |
|
|
|
CONTACT_ADD_ROUTE, |
|
|
|
CONTACT_ADD_ROUTE, |
|
|
|
CONTACT_VIEW_ROUTE, |
|
|
|
CONTACT_VIEW_ROUTE, |
|
|
|
} from '../../../helpers/constants/routes'; |
|
|
|
} from '../../../helpers/constants/routes'; |
|
|
|
|
|
|
|
import Button from '../../../components/ui/button'; |
|
|
|
import EditContact from './edit-contact'; |
|
|
|
import EditContact from './edit-contact'; |
|
|
|
import AddContact from './add-contact'; |
|
|
|
import AddContact from './add-contact'; |
|
|
|
import ViewContact from './view-contact'; |
|
|
|
import ViewContact from './view-contact'; |
|
|
@ -66,6 +67,25 @@ export default class ContactListTab extends Component { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
renderAddButton() { |
|
|
|
|
|
|
|
const { history } = this.props; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
|
|
|
<div className="address-book-add-button"> |
|
|
|
|
|
|
|
<Button |
|
|
|
|
|
|
|
className="address-book-add-button__button" |
|
|
|
|
|
|
|
type="secondary" |
|
|
|
|
|
|
|
rounded |
|
|
|
|
|
|
|
onClick={() => { |
|
|
|
|
|
|
|
history.push(CONTACT_ADD_ROUTE); |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
{this.context.t('addContact')} |
|
|
|
|
|
|
|
</Button> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
renderContactContent() { |
|
|
|
renderContactContent() { |
|
|
|
const { |
|
|
|
const { |
|
|
|
viewingContact, |
|
|
|
viewingContact, |
|
|
@ -106,10 +126,13 @@ export default class ContactListTab extends Component { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
render() { |
|
|
|
|
|
|
|
const { addingContact, addressBook } = this.props; |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div className="address-book-wrapper"> |
|
|
|
<div className="address-book-wrapper"> |
|
|
|
{this.renderAddressBookContent()} |
|
|
|
{this.renderAddressBookContent()} |
|
|
|
{this.renderContactContent()} |
|
|
|
{this.renderContactContent()} |
|
|
|
|
|
|
|
{!addingContact && addressBook.length > 0 && this.renderAddButton()} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|