Skip to content

Commit 68c535d

Browse files
authored
adjust ui style on conversation (#128)
* support new contactmatcher * fix button style * fix typo * show 99+ if noticeCounts > 99 * update commons version * react-scripts force version
1 parent eaa7d4c commit 68c535d

File tree

8 files changed

+29
-31
lines changed

8 files changed

+29
-31
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"react-router": "^3.0.0",
3232
"ringcentral": "3.0.0",
3333
"ringcentral-client": "^1.0.0-rc1",
34-
"ringcentral-integration": "^0.4.4",
34+
"ringcentral-integration": "^0.5.2",
3535
"whatwg-fetch": "^2.0.1"
3636
},
3737
"devDependencies": {
@@ -73,13 +73,13 @@
7373
"react-addons-test-utils": "^15.4.2",
7474
"react-dom": "^15.4.1",
7575
"react-redux": "^5.0.1",
76-
"react-scripts": "^0.9.3",
76+
"react-scripts": "0.9.3",
7777
"redux": "^3.6.0",
7878
"redux-logger": "^2.7.4",
7979
"redux-thunk": "^2.1.0",
8080
"ringcentral": "3.0.0",
8181
"ringcentral-client": "^1.0.0-rc1",
82-
"ringcentral-integration": "^0.4.4",
82+
"ringcentral-integration": "^0.5.2",
8383
"sass-loader": "^4.1.1",
8484
"source-map-loader": "^0.1.5",
8585
"style-loader": "^0.13.1",

src/components/NavigationBar/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function NavigationButton(props) {
88
let notice = null;
99
if (props.noticeCounts && props.noticeCounts > 0) {
1010
if (props.noticeCounts > 99) {
11-
notice = <div className={styles.notices}>{props.noticeCounts}</div>;
11+
notice = <div className={styles.notices}>99+</div>;
1212
} else {
1313
notice = <div className={styles.notice}>{props.noticeCounts}</div>;
1414
}

src/components/NavigationBar/styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
line-height: 1.8em;
9696
font-family: Lato;
9797
text-align: center;
98-
font-size: 0.7em;
98+
font-size: 0.6em;
9999
background-color: $rc-orange;
100100
overflow: hidden;
101101
}

src/components/RecipientsHeader/styles.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020

2121
&:focus {
2222
outline: none;
23+
text-decoration: none;
24+
color: inherit;
25+
}
26+
27+
&:hover {
28+
text-decoration: none;
29+
color: inherit;
2330
}
2431
}
2532
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
.containner {
22
text-decoration: none;
33
color: #666666;
4+
&:hover {
5+
text-decoration: none;
6+
color: #666666;
7+
}
48
}
59

610
.hiddenRemoveButton {
711
color: transparent;
812
text-decoration: none;
13+
&:hover {
14+
color: transparent;
15+
}
916
}

src/containers/ConversationPage/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ function mapDispatchToProps(dispatch, props) {
106106
if (props.contactMatcher && props.contactMatcher.ready) {
107107
matcherContactName = (phoneNumber) => {
108108
const matcherNames = props.contactMatcher.dataMapping[phoneNumber];
109-
if (matcherNames && matcherNames[0] && matcherNames[0].name) {
110-
return matcherNames[0].name;
109+
if (matcherNames && matcherNames.length > 0) {
110+
return matcherNames.map(matcher => matcher.name).join('&');
111111
}
112112
return null;
113113
};

src/containers/MessagesPage/i18n/en-US.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ export default {
22
title: 'Messages',
33
search: 'Search...',
44
noMessages: 'No Messages',
5-
noSearchResults: 'No matching record found',
5+
noSearchResults: 'No matching records found',
66
};

src/containers/MessagesPage/index.js

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ class MessagesPage extends Component {
4040
}
4141
return recipients.map((recipient) => {
4242
const phoneNumber = recipient.phoneNumber || recipient.extensionNumber;
43-
if (phoneNumber && this.props.matcherContactName) {
44-
const matcherName = this.props.matcherContactName(phoneNumber);
45-
if (matcherName) {
43+
if (recipient.matchedNames) {
44+
const matcherName = recipient.matchedNames.map(matcher => matcher.name).join('&');
45+
if (matcherName.length > 0) {
4646
return matcherName;
4747
}
4848
return this.props.formatPhone(phoneNumber);
@@ -63,9 +63,9 @@ class MessagesPage extends Component {
6363
if (searchNumber && searchNumber.length > 0 && phoneNumber.indexOf(searchNumber) >= 0) {
6464
return true;
6565
}
66-
if (this.props.matcherContactName) {
67-
const matcherName = this.props.matcherContactName(phoneNumber);
68-
if (matcherName) {
66+
if (recipient.matchedNames) {
67+
const matcherName = recipient.matchedNames.map(matcher => matcher.name).join('&');
68+
if (matcherName.length > 0) {
6969
recipientName = matcherName;
7070
} else {
7171
recipientName = phoneNumber;
@@ -175,17 +175,12 @@ MessagesPage.propTypes = {
175175
getRecipientsList: PropTypes.func.isRequired,
176176
searchMessagesText: PropTypes.func.isRequired,
177177
updateSearchResults: PropTypes.func.isRequired,
178-
matcherContactName: PropTypes.func,
179-
};
180-
181-
MessagesPage.defaultProps = {
182-
matcherContactName: null,
183178
};
184179

185180
function mapStateToProps(state, props) {
186181
return ({
187182
currentLocale: props.locale.currentLocale,
188-
messages: props.messages.messages,
183+
messages: props.messages.normalizedMessages,
189184
allMessages: props.messageStore.conversations,
190185
showSpinner: (
191186
!props.messages.ready ||
@@ -200,16 +195,6 @@ function mapStateToProps(state, props) {
200195
}
201196

202197
function mapDispatchToProps(dispatch, props) {
203-
let matcherContactName = null;
204-
if (props.contactMatcher && props.contactMatcher.ready) {
205-
matcherContactName = (phoneNumber) => {
206-
const matcherNames = props.contactMatcher.dataMapping[phoneNumber];
207-
if (matcherNames && matcherNames[0] && matcherNames[0].name) {
208-
return matcherNames[0].name;
209-
}
210-
return null;
211-
};
212-
}
213198
return {
214199
loadNextPageMessages: props.messages.loadNextPageMessages,
215200
updateSearchingString: props.messages.updateSearchingString,
@@ -228,7 +213,6 @@ function mapDispatchToProps(dispatch, props) {
228213
}),
229214
searchMessagesText: searchText =>
230215
props.messageStore.searchMessagesText(searchText),
231-
matcherContactName,
232216
};
233217
}
234218

0 commit comments

Comments
 (0)