-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Guides call request flow to workspace card configuration screen #4637
Changes from 7 commits
6d2ab5c
a458099
1a60440
3f8c5cb
9dd5edb
b9b2a2d
df251c7
3ca524a
c2e0b6e
853c14e
71d3f50
d87afd3
9449998
18bb7bb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ import Icon from './Icon'; | |
import {Close, Download, BackArrow} from './Icon/Expensicons'; | ||
import compose from '../libs/compose'; | ||
import withLocalize, {withLocalizePropTypes} from './withLocalize'; | ||
import InboxCallButton from './InboxCallButton'; | ||
|
||
const propTypes = { | ||
/** Title of the Header */ | ||
|
@@ -32,6 +33,11 @@ const propTypes = { | |
/** Whether we should show a download button */ | ||
shouldShowDownloadButton: PropTypes.bool, | ||
|
||
/** Whether weshould show a inbox call button */ | ||
shouldShowInboxCallButton: PropTypes.bool, | ||
|
||
alex-mechler marked this conversation as resolved.
Show resolved
Hide resolved
|
||
inboxCallTaskID: PropTypes.string, | ||
|
||
...withLocalizePropTypes, | ||
}; | ||
|
||
|
@@ -43,6 +49,8 @@ const defaultProps = { | |
shouldShowBackButton: false, | ||
shouldShowBorderBottom: false, | ||
shouldShowDownloadButton: false, | ||
shouldShowInboxCallButton: false, | ||
inboxCallTaskID: '', | ||
}; | ||
|
||
const HeaderWithCloseButton = props => ( | ||
|
@@ -77,6 +85,11 @@ const HeaderWithCloseButton = props => ( | |
) | ||
} | ||
|
||
{ | ||
props.shouldShowInboxCallButton && <InboxCallButton taskID={props.inboxCallTaskID} /> | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove the unnecessary line break |
||
} | ||
|
||
<TouchableOpacity | ||
onPress={props.onCloseButtonPress} | ||
style={[styles.touchableButtonImage]} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React from 'react'; | ||
import { | ||
View, Pressable, | ||
} from 'react-native'; | ||
import PropTypes from 'prop-types'; | ||
import Icon from './Icon'; | ||
import {Phone} from './Icon/Expensicons'; | ||
import styles from '../styles/styles'; | ||
import themeColors from '../styles/themes/default'; | ||
import withLocalize, {withLocalizePropTypes} from './withLocalize'; | ||
import compose from '../libs/compose'; | ||
import Navigation from '../libs/Navigation/Navigation'; | ||
import ROUTES from '../ROUTES'; | ||
import Text from './Text'; | ||
|
||
const propTypes = { | ||
...withLocalizePropTypes, | ||
taskID: PropTypes.string, | ||
}; | ||
|
||
const defaultProps = { | ||
taskID: '', | ||
}; | ||
|
||
const InboxCallButton = props => ( | ||
<> | ||
<View | ||
style={[styles.flex1, styles.flexRow, styles.justifyContentCenter, styles.alignItemsCenter]} | ||
> | ||
<Pressable | ||
onPress={() => { | ||
Navigation.navigate(ROUTES.getRequestCallRoute(props.taskID)); | ||
}} | ||
style={[styles.button, styles.buttonSmall]} | ||
> | ||
<View style={styles.flexRow}> | ||
<View style={styles.mr1}> | ||
<Icon | ||
src={Phone} | ||
fill={themeColors.heading} | ||
small | ||
/> | ||
</View> | ||
<View> | ||
<Text style={styles.buttonText}> | ||
{props.translate('requestCallPage.needHelp')} | ||
</Text> | ||
</View> | ||
</View> | ||
</Pressable> | ||
</View> | ||
</> | ||
); | ||
|
||
InboxCallButton.propTypes = propTypes; | ||
InboxCallButton.defaultProps = defaultProps; | ||
InboxCallButton.displayName = 'InboxCallButton'; | ||
export default compose(withLocalize)(InboxCallButton); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,11 +21,13 @@ import ROUTES from '../ROUTES'; | |
const propTypes = { | ||
...withLocalizePropTypes, | ||
...windowDimensionsPropTypes, | ||
isConcierge: PropTypes.bool, | ||
openInboxCall: PropTypes.bool, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If you'd like to keep inboxCall then maybe add some comments explaining what happens if this variable is true or false. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yes, before all the design changes, the new button also used this flow, so the variable name was changed. Since the design changes mean they are two different flows, I will change this back! Good catch |
||
taskID: PropTypes.string, | ||
}; | ||
|
||
const defaultProps = { | ||
isConcierge: false, | ||
openInboxCall: false, | ||
taskID: '', | ||
}; | ||
|
||
class VideoChatButtonAndMenu extends Component { | ||
|
@@ -98,8 +100,8 @@ class VideoChatButtonAndMenu extends Component { | |
<Pressable | ||
onPress={() => { | ||
// If this is the Concierge chat, we'll open the modal for requesting a setup call instead | ||
alex-mechler marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if (this.props.isConcierge) { | ||
Navigation.navigate(ROUTES.REQUEST_CALL); | ||
if (this.props.openInboxCall) { | ||
Navigation.navigate(ROUTES.getRequestCallRoute(this.props.taskID)); | ||
return; | ||
} | ||
this.toggleVideoChatMenu(); | ||
|
@@ -108,7 +110,7 @@ class VideoChatButtonAndMenu extends Component { | |
> | ||
<Icon | ||
src={Phone} | ||
fill={(this.props.isConcierge || this.state.isVideoChatMenuActive) | ||
fill={(this.props.openInboxCall || this.state.isVideoChatMenuActive) | ||
? themeColors.heading | ||
: themeColors.icon} | ||
/> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import {Inbox_CallUser} from '../API'; | ||
|
||
function requestConciergeDMCall(policyID, firstName, lastName, phoneNumber) { | ||
function requestInboxCall(taskID, policyID, firstName, lastName, phoneNumber) { | ||
return Inbox_CallUser({ | ||
policyID, | ||
firstName, | ||
lastName, | ||
phoneNumber, | ||
taskID: 'NewExpensifyConciergeDM', | ||
taskID, | ||
}); | ||
} | ||
|
||
// eslint-disable-next-line import/prefer-default-export | ||
export {requestConciergeDMCall}; | ||
export {requestInboxCall}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,7 +158,7 @@ const HeaderView = (props) => { | |
{props.report.hasOutstandingIOU && ( | ||
<IOUBadge iouReportID={props.report.iouReportID} /> | ||
)} | ||
<VideoChatButtonAndMenu isConcierge={isConcierge} /> | ||
<VideoChatButtonAndMenu openInboxCall={isConcierge} taskID="ExpensifyCashConciergeDM" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thoughts on making the 2nd param consistent and more verbose i.e., instead of
|
||
<Pressable | ||
onPress={() => togglePinnedState(props.report)} | ||
style={[styles.touchableButtonImage, styles.mr0]} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.