diff --git a/dev-server/Phone.js b/dev-server/Phone.js index 817a8be865..cabec8c009 100644 --- a/dev-server/Phone.js +++ b/dev-server/Phone.js @@ -53,6 +53,7 @@ import ActivityMatcher from 'ringcentral-integration/modules/ActivityMatcher'; import CallLogger from 'ringcentral-integration/modules/CallLogger'; import ConversationMatcher from 'ringcentral-integration/modules/ConversationMatcher'; import ConversationLogger from 'ringcentral-integration/modules/ConversationLogger'; +import RecentMessages from 'ringcentral-integration/modules/RecentMessages'; import RouterInteraction from '../src/modules/RouterInteraction'; @@ -563,6 +564,13 @@ export default class Phone extends RcModule { getState: () => this.state.messages, })); reducers.messages = this.messages.reducer; + this.addModule('recentMessages', new RecentMessages({ + ...options, + client: this.client, + messageStore: this.messageStore, + getState: () => this.state.recentMessages + })); + reducers.recentMessages = this.recentMessages.reducer; this._reducer = combineReducers({ ...reducers, app: (state = { diff --git a/dev-server/containers/App/index.js b/dev-server/containers/App/index.js index 46267ca4ba..3cef1b8b36 100644 --- a/dev-server/containers/App/index.js +++ b/dev-server/containers/App/index.js @@ -19,11 +19,10 @@ import CallHistoryPage from '../../../src/containers/CallHistoryPage'; import IncomingCallPage from '../../../src/containers/IncomingCallPage'; import CallCtrlPage from '../../../src/containers/CallCtrlPage'; import CallBadgeContainer from '../../../src/containers/CallBadgeContainer'; - +import RecentActivityContainer from '../../../src/containers/RecentActivityContainer'; import MainView from '../MainView'; import AppView from '../AppView'; - export default function App({ phone, }) { @@ -73,6 +72,14 @@ export default function App({ callingSettingsUrl="/settings/calling" regionSettingsUrl="/settings/region" /> + )} > @@ -126,7 +133,8 @@ export default function App({ regionSettingsUrl="/settings/region" callingSettingsUrl="/settings/calling" /> - )} /> + )} + /> ( @@ -187,7 +195,16 @@ export default function App({ return avatarUrl; } } - /> + > + + )} /> alert(`go to ${path}`) const NavigationBarDemo = () => ( ); diff --git a/package.json b/package.json index 04f1c3c7c7..128a1ed64c 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "react-router-redux": "^4.0.7", "ringcentral": "3.1.1", "ringcentral-client": "^1.0.0-rc1", - "ringcentral-integration": "^0.7.0-rc8", + "ringcentral-integration": "^0.7.0-rc14", "whatwg-fetch": "^2.0.1" }, "devDependencies": { @@ -84,7 +84,7 @@ "redux-thunk": "^2.1.0", "ringcentral": "^3.1.1", "ringcentral-client": "^1.0.0-rc1", - "ringcentral-integration": "^0.7.0-rc13", + "ringcentral-integration": "^0.7.0-rc14", "sass-loader": "^6.0.5", "source-map-loader": "^0.2.1", "style-loader": "^0.18.2", diff --git a/src/components/NavigationBar/index.js b/src/components/NavigationBar/index.js index 50d0e9688d..1617f42813 100644 --- a/src/components/NavigationBar/index.js +++ b/src/components/NavigationBar/index.js @@ -3,67 +3,11 @@ import PropTypes from 'prop-types'; import classnames from 'classnames'; import styles from './styles.scss'; - -function NavigationButton({ - active, - activeIcon, - icon, - label, - noticeCounts, - onClick, - width, -}) { - let notice = null; - if (noticeCounts && noticeCounts > 0) { - if (noticeCounts > 99) { - notice =
99+
; - } else { - notice =
{noticeCounts}
; - } - } - return ( -
-
-
- {active ? activeIcon : icon } -
- {notice} -
-
- ); -} -NavigationButton.propTypes = { - icon: PropTypes.node.isRequired, - activeIcon: PropTypes.node.isRequired, - active: PropTypes.bool, - label: PropTypes.string, - noticeCounts: PropTypes.number, - width: PropTypes.oneOfType([ - PropTypes.number, - PropTypes.string, - ]).isRequired, - onClick: PropTypes.func, -}; -NavigationButton.defaultProps = { - active: false, - label: undefined, - noticeCounts: undefined, - onClick: undefined, -}; - function NavigationBar(props) { const tabWidth = props.tabs.length > 0 ? `${(1 / props.tabs.length) * 100}%` : 0; + const NavigationButton = props.button; return (