Skip to content

Commit

Permalink
Merge pull request #3988 from parasharrajat/scrollview
Browse files Browse the repository at this point in the history
fixed scrolling and layout
  • Loading branch information
tgolen authored Jul 13, 2021
2 parents bd675f9 + f3e0785 commit 8c98a64
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 90 deletions.
99 changes: 51 additions & 48 deletions src/pages/RequestCallPage.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {Component} from 'react';
import {View, TextInput} from 'react-native';
import {ScrollView, TextInput} from 'react-native';
import _ from 'underscore';
import {withOnyx} from 'react-native-onyx';
import PropTypes from 'prop-types';
Expand All @@ -20,6 +20,7 @@ import {requestConciergeDMCall} from '../libs/actions/Inbox';
import {fetchOrCreateChatReport} from '../libs/actions/Report';
import personalDetailsPropType from './personalDetailsPropType';
import Text from '../components/Text';
import KeyboardAvoidingView from '../components/KeyboardAvoidingView';

const propTypes = {
...withLocalizePropTypes,
Expand Down Expand Up @@ -143,54 +144,56 @@ class RequestCallPage extends Component {
const isButtonDisabled = false;
return (
<ScreenWrapper>
<HeaderWithCloseButton
title={this.props.translate('requestCallPage.requestACall')}
shouldShowBackButton
onBackButtonPress={() => fetchOrCreateChatReport([
this.props.session.email,
CONST.EMAIL.CONCIERGE,
], true)}
onCloseButtonPress={() => Navigation.dismissModal(true)}
/>
<View style={[styles.flex1, styles.p5]}>
<Text style={[styles.mb4]}>
{this.props.translate('requestCallPage.description')}
</Text>
<Text style={[styles.mt4, styles.mb4]}>
{this.props.translate('requestCallPage.instructions')}
</Text>
<FullNameInputRow
firstName={this.state.firstName}
lastName={this.state.lastName}
onChangeFirstName={firstName => this.setState({firstName})}
onChangeLastName={lastName => this.setState({lastName})}
style={[styles.mt4, styles.mb4]}
<KeyboardAvoidingView>
<HeaderWithCloseButton
title={this.props.translate('requestCallPage.requestACall')}
shouldShowBackButton
onBackButtonPress={() => fetchOrCreateChatReport([
this.props.session.email,
CONST.EMAIL.CONCIERGE,
], true)}
onCloseButtonPress={() => Navigation.dismissModal(true)}
/>
<Text style={[styles.mt4, styles.formLabel]} numberOfLines={1}>
{this.props.translate('common.phoneNumber')}
</Text>
<TextInput
autoCompleteType="off"
autoCorrect={false}
style={[styles.textInput]}
value={this.state.phoneNumber}
placeholder="+14158675309"
onChangeText={phoneNumber => this.setState({phoneNumber})}
/>
<Text style={[styles.mt4, styles.textLabel, styles.colorMuted, styles.mb6]}>
{this.props.translate('requestCallPage.availabilityText')}
</Text>
</View>
<FixedFooter>
<Button
success
isDisabled={isButtonDisabled}
onPress={this.onSubmit}
style={[styles.w100]}
text={this.props.translate('requestCallPage.callMe')}
isLoading={this.state.isLoading}
/>
</FixedFooter>
<ScrollView style={styles.flex1} contentContainerStyle={styles.p5}>
<Text style={[styles.mb4]}>
{this.props.translate('requestCallPage.description')}
</Text>
<Text style={[styles.mt4, styles.mb4]}>
{this.props.translate('requestCallPage.instructions')}
</Text>
<FullNameInputRow
firstName={this.state.firstName}
lastName={this.state.lastName}
onChangeFirstName={firstName => this.setState({firstName})}
onChangeLastName={lastName => this.setState({lastName})}
style={[styles.mt4, styles.mb4]}
/>
<Text style={[styles.mt4, styles.formLabel]} numberOfLines={1}>
{this.props.translate('common.phoneNumber')}
</Text>
<TextInput
autoCompleteType="off"
autoCorrect={false}
style={[styles.textInput]}
value={this.state.phoneNumber}
placeholder="+14158675309"
onChangeText={phoneNumber => this.setState({phoneNumber})}
/>
<Text style={[styles.mt4, styles.textLabel, styles.colorMuted, styles.mb6]}>
{this.props.translate('requestCallPage.availabilityText')}
</Text>
</ScrollView>
<FixedFooter>
<Button
success
isDisabled={isButtonDisabled}
onPress={this.onSubmit}
style={[styles.w100]}
text={this.props.translate('requestCallPage.callMe')}
isLoading={this.state.isLoading}
/>
</FixedFooter>
</KeyboardAvoidingView>
</ScreenWrapper>
);
}
Expand Down
79 changes: 38 additions & 41 deletions src/pages/workspace/WorkspaceInvitePage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import {ScrollView, TextInput, View} from 'react-native';
import {TextInput, View, ScrollView} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import Str from 'expensify-common/lib/str';
import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize';
Expand All @@ -17,8 +17,8 @@ import TextLink from '../../components/TextLink';
import getEmailKeyboardType from '../../libs/getEmailKeyboardType';
import themeColors from '../../styles/themes/default';
import Growl from '../../libs/Growl';
import KeyboardAvoidingView from '../../components/KeyboardAvoidingView';
import FixedFooter from '../../components/FixedFooter';
import KeyboardAvoidingView from '../../components/KeyboardAvoidingView';

const propTypes = {
...withLocalizePropTypes,
Expand Down Expand Up @@ -90,51 +90,48 @@ class WorkspaceInvitePage extends React.Component {
title={this.props.translate('workspace.invite.invitePeople')}
onCloseButtonPress={Navigation.dismissModal}
/>
<ScrollView style={[styles.p5, styles.flex1, styles.overflowAuto]}>
<View style={styles.flexGrow1}>
<Text style={[styles.mb6]}>
{this.props.translate('workspace.invite.invitePeoplePrompt')}
<ScrollView style={styles.flex1} contentContainerStyle={styles.p5}>
<Text style={[styles.mb6]}>
{this.props.translate('workspace.invite.invitePeoplePrompt')}
</Text>
<View style={styles.mb6}>
<Text style={[styles.mb2]}>
{this.props.translate('workspace.invite.enterEmailOrPhone')}
</Text>
<TextInput
autoCompleteType="email"
autoCorrect={false}
autoCapitalize="none"
style={[styles.textInput]}
value={this.state.emailOrPhone}
keyboardType={getEmailKeyboardType()}
onChangeText={text => this.setState({emailOrPhone: text})}
/>
</View>
<View style={styles.mb6}>
<Text style={[styles.mb2]}>
{this.props.translate('workspace.invite.personalMessagePrompt')}
</Text>
<View style={styles.mb6}>
<Text style={[styles.mb2]}>
{this.props.translate('workspace.invite.enterEmailOrPhone')}
</Text>
<TextInput
autoCompleteType="email"
autoCorrect={false}
autoCapitalize="none"
style={[styles.textInput]}
value={this.state.emailOrPhone}
keyboardType={getEmailKeyboardType()}
onChangeText={text => this.setState({emailOrPhone: text})}
/>
</View>
<View style={styles.mb6}>
<Text style={[styles.mb2]}>
{this.props.translate('workspace.invite.personalMessagePrompt')}
</Text>
<TextInput
autoCompleteType="off"
autoCorrect={false}
style={[styles.textInput, styles.workspaceInviteWelcome, styles.mb6]}
numberOfLines={10}
textAlignVertical="top"
multiline
value={this.state.welcomeNote}
placeholder={this.getWelcomeNotePlaceholder()}
placeholderTextColor={themeColors.placeholderText}
onChangeText={text => this.setState({welcomeNote: text})}
/>
<TextLink href="https://use.expensify.com/privacy">
{this.props.translate('common.privacy')}
</TextLink>
</View>
<TextInput
autoCompleteType="off"
autoCorrect={false}
style={[styles.textInput, styles.workspaceInviteWelcome, styles.mb6]}
numberOfLines={10}
textAlignVertical="top"
multiline
value={this.state.welcomeNote}
placeholder={this.getWelcomeNotePlaceholder()}
placeholderTextColor={themeColors.placeholderText}
onChangeText={text => this.setState({welcomeNote: text})}
/>
<TextLink href="https://use.expensify.com/privacy">
{this.props.translate('common.privacy')}
</TextLink>
</View>
</ScrollView>
<FixedFooter style={[styles.flexGrow0]}>
<Button
success
style={[styles.mb2]}
isDisabled={!this.state.emailOrPhone}
text={this.props.translate('common.invite')}
onPress={this.inviteUser}
Expand Down
2 changes: 1 addition & 1 deletion src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,7 @@ const styles = {
},

workspaceInviteWelcome: {
minHeight: 150,
height: 150,
},

peopleRow: {
Expand Down

0 comments on commit 8c98a64

Please sign in to comment.