Skip to content

Commit bc24d9e

Browse files
authored
Ensure method of adding contact when contacts exist (#10963)
1 parent 7c60226 commit bc24d9e

File tree

2 files changed

+28
-14
lines changed

2 files changed

+28
-14
lines changed

ui/pages/settings/contact-list-tab/contact-list-tab.component.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
CONTACT_ADD_ROUTE,
66
CONTACT_VIEW_ROUTE,
77
} from '../../../helpers/constants/routes';
8+
import Button from '../../../components/ui/button';
89
import EditContact from './edit-contact';
910
import AddContact from './add-contact';
1011
import ViewContact from './view-contact';
@@ -66,6 +67,25 @@ export default class ContactListTab extends Component {
6667
);
6768
}
6869

70+
renderAddButton() {
71+
const { history } = this.props;
72+
73+
return (
74+
<div className="address-book-add-button">
75+
<Button
76+
className="address-book-add-button__button"
77+
type="secondary"
78+
rounded
79+
onClick={() => {
80+
history.push(CONTACT_ADD_ROUTE);
81+
}}
82+
>
83+
{this.context.t('addContact')}
84+
</Button>
85+
</div>
86+
);
87+
}
88+
6989
renderContactContent() {
7090
const {
7191
viewingContact,
@@ -106,10 +126,13 @@ export default class ContactListTab extends Component {
106126
}
107127

108128
render() {
129+
const { addingContact, addressBook } = this.props;
130+
109131
return (
110132
<div className="address-book-wrapper">
111133
{this.renderAddressBookContent()}
112134
{this.renderContactContent()}
135+
{!addingContact && addressBook.length > 0 && this.renderAddButton()}
113136
</div>
114137
);
115138
}

ui/pages/settings/contact-list-tab/index.scss

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -250,23 +250,14 @@
250250
.address-book-add-button {
251251
&__button {
252252
position: absolute;
253-
top: 80px;
253+
top: 85px;
254254
right: 16px;
255-
height: 56px;
256-
width: 56px;
257-
border-radius: 18px;
258-
display: flex;
259-
justify-content: center;
260-
align-items: center;
261-
border-radius: 50%;
262-
border-width: 1px;
263-
background: $primary-blue;
264-
margin-right: 5px;
265-
cursor: pointer;
266-
box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
255+
width: auto;
256+
border-radius: 100px;
267257

268258
@media screen and (max-width: 576px) {
269-
top: 10px;
259+
top: 16px;
260+
right: 60px;
270261
}
271262
}
272263
}

0 commit comments

Comments
 (0)