Skip to content
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

fixed scrolling and layout #3988

Merged
merged 3 commits into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1716,7 +1716,7 @@ const styles = {
},

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

peopleRow: {
Expand Down