-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Create the RequestCallPage #3697
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
Merged
Merged
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
36fcc06
setup for navigation
jasperhuangg 5dddf4e
Navigate to the request call page from the Concierge DM
jasperhuangg 0099005
Fix syntax, style
jasperhuangg dc5487d
whitespace
jasperhuangg 95e29ab
fix import
jasperhuangg 6658651
Merge main
jasperhuangg 47e5009
Fix merge conflict
jasperhuangg 842fe58
Fix merge conflict
jasperhuangg c86a520
Get nav working
jasperhuangg e0ddd97
Merge branch 'jasper-requestCallLocalization' of github.com:Expensify…
jasperhuangg 3c14352
Add NameEntryInputRow component
jasperhuangg ab198b7
rename component + setup required fields
jasperhuangg e25abcc
Handle errors thrown by the API
jasperhuangg 595d09e
Fix case where reports weren't loaded and we were trying to access r…
jasperhuangg 7992059
style
jasperhuangg 8e4cff8
Add availability text
jasperhuangg 96e7f26
remove whitespace
jasperhuangg fb5c2c3
fix color of call button for Concierge chats
jasperhuangg aa9b5df
Merge branch 'main' into jasper-requestCallPageNavSetup
jasperhuangg 9ceb2d4
cleanup imports and propTypes + fix merge conflict
jasperhuangg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import * as React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import {TextInput, View} from 'react-native'; | ||
import _ from 'underscore'; | ||
import styles from '../styles/styles'; | ||
import Text from './Text'; | ||
import themeColors from '../styles/themes/default'; | ||
import withLocalize, {withLocalizePropTypes} from './withLocalize'; | ||
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 use JSX then |
||
|
||
const propTypes = { | ||
...withLocalizePropTypes, | ||
|
||
/** Called when text is entered into the firstName input */ | ||
onChangeFirstName: PropTypes.func.isRequired, | ||
|
||
/** Called when text is entered into the lastName input */ | ||
onChangeLastName: PropTypes.func.isRequired, | ||
|
||
/** Used to prefill the firstName input, can also be used to make it a controlled input */ | ||
firstName: PropTypes.string, | ||
|
||
/** Placeholder text for the firstName input */ | ||
firstNamePlaceholder: PropTypes.string, | ||
|
||
/** Used to prefill the lastName input, can also be used to make it a controlled input */ | ||
lastName: PropTypes.string, | ||
|
||
/** Placeholder text for the lastName input */ | ||
lastNamePlaceholder: PropTypes.string, | ||
|
||
/** Additional styles to add after local styles */ | ||
style: PropTypes.oneOfType([ | ||
PropTypes.arrayOf(PropTypes.object), | ||
PropTypes.object, | ||
]), | ||
}; | ||
const defaultProps = { | ||
firstName: '', | ||
firstNamePlaceholder: null, | ||
lastName: '', | ||
lastNamePlaceholder: null, | ||
style: {}, | ||
}; | ||
|
||
const FullNameInputRow = ({ | ||
translate, | ||
onChangeFirstName, onChangeLastName, | ||
firstName, lastName, | ||
firstNamePlaceholder, | ||
lastNamePlaceholder, | ||
style, | ||
}) => { | ||
const additionalStyles = _.isArray(style) ? style : [style]; | ||
return ( | ||
<View style={[styles.flexRow, ...additionalStyles]}> | ||
<View style={styles.flex1}> | ||
<Text style={[styles.mb1, styles.formLabel]}> | ||
{translate('common.firstName')} | ||
</Text> | ||
<TextInput | ||
style={styles.textInput} | ||
value={firstName} | ||
onChangeText={onChangeFirstName} | ||
placeholder={firstNamePlaceholder ?? translate('profilePage.john')} | ||
placeholderTextColor={themeColors.placeholderText} | ||
/> | ||
</View> | ||
<View style={[styles.flex1, styles.ml2]}> | ||
<Text style={[styles.mb1, styles.formLabel]}> | ||
{translate('common.lastName')} | ||
</Text> | ||
<TextInput | ||
style={styles.textInput} | ||
value={lastName} | ||
onChangeText={onChangeLastName} | ||
placeholder={lastNamePlaceholder ?? translate('profilePage.doe')} | ||
placeholderTextColor={themeColors.placeholderText} | ||
/> | ||
</View> | ||
</View> | ||
); | ||
}; | ||
|
||
FullNameInputRow.displayName = 'FullNameInputRow'; | ||
FullNameInputRow.propTypes = propTypes; | ||
FullNameInputRow.defaultProps = defaultProps; | ||
export default withLocalize(FullNameInputRow); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.