Fixed padding issues

This commit is contained in:
Arnaud Vergnet 2020-04-18 17:20:07 +02:00
parent 8e7b213b4f
commit f8e53a8a72
8 changed files with 41 additions and 22 deletions

View file

@ -3,6 +3,8 @@
import * as React from 'react';
import {withTheme} from 'react-native-paper';
import {Modalize} from "react-native-modalize";
import {View} from "react-native-animatable";
import CustomTabBar from "../Tabbar/CustomTabBar";
/**
* Abstraction layer for Modalize component, using custom configuration
@ -20,7 +22,12 @@ function CustomModal(props) {
modalStyle={{backgroundColor: colors.card}}
handleStyle={{backgroundColor: colors.primary}}
>
{props.children}
<View style={{
paddingBottom: CustomTabBar.TAB_BAR_HEIGHT
}}>
{props.children}
</View>
</Modalize>
);
}

View file

@ -261,6 +261,9 @@ class WebSectionList extends React.PureComponent<Props, State> {
},
}}
duration={4000}
style={{
bottom: CustomTabBar.TAB_BAR_HEIGHT
}}
>
{i18n.t("homeScreen.listUpdateFail")}
</Snackbar>

View file

@ -7,6 +7,7 @@ import ImageModal from 'react-native-image-modal';
import i18n from "i18n-js";
import AuthenticatedScreen from "../../../components/Amicale/AuthenticatedScreen";
import CustomHTML from "../../../components/Custom/CustomHTML";
import CustomTabBar from "../../../components/Tabbar/CustomTabBar";
type Props = {
navigation: Object,
@ -90,7 +91,7 @@ class ClubDisplayScreen extends React.Component<Props, State> {
}
const hasManagers = resp.length > 0;
return (
<Card style={{marginTop: 10, marginBottom: 10}}>
<Card style={{marginTop: 10, marginBottom: CustomTabBar.TAB_BAR_HEIGHT + 20}}>
<Card.Title
title={i18n.t('clubs.managers')}
subtitle={hasManagers ? i18n.t('clubs.managersSubtitle') : i18n.t('clubs.managersUnavailable')}

View file

@ -7,6 +7,7 @@ import ImageModal from 'react-native-image-modal';
import Autolink from "react-native-autolink";
import MaterialHeaderButtons, {Item} from "../components/Custom/HeaderButton";
import {Linking} from "expo";
import CustomTabBar from "../components/Tabbar/CustomTabBar";
type Props = {
navigation: Object,
@ -58,7 +59,7 @@ class FeedItemScreen extends React.Component<Props> {
getContent() {
const hasImage = this.displayData.full_picture !== '' && this.displayData.full_picture !== undefined;
return (
<ScrollView style={{margin: 5}}>
<ScrollView style={{margin: 5,}}>
<Card.Title
title={NAME_AMICALE}
subtitle={this.date}
@ -77,7 +78,7 @@ class FeedItemScreen extends React.Component<Props> {
uri: this.displayData.full_picture,
}}
/></View> : null}
<Card.Content>
<Card.Content style={{paddingBottom: CustomTabBar.TAB_BAR_HEIGHT + 20}}>
{this.displayData.message !== undefined ?
<Autolink
text={this.displayData.message}

View file

@ -10,6 +10,7 @@ import BasicLoadingScreen from "../../components/Custom/BasicLoadingScreen";
import {apiRequest} from "../../utils/WebData";
import ErrorView from "../../components/Custom/ErrorView";
import CustomHTML from "../../components/Custom/CustomHTML";
import CustomTabBar from "../../components/Tabbar/CustomTabBar";
type Props = {
navigation: Object,
@ -104,7 +105,7 @@ class PlanningDisplayScreen extends React.Component<Props, State> {
: <View/>}
{this.displayData.description !== null ?
<Card.Content>
<Card.Content style={{paddingBottom: CustomTabBar.TAB_BAR_HEIGHT + 20}}>
<CustomHTML html={this.displayData.description}/>
</Card.Content>
: <View/>}

View file

@ -4,6 +4,7 @@ import * as React from 'react';
import {Image, ScrollView, View} from 'react-native';
import i18n from "i18n-js";
import {Card, List, Paragraph, Text} from 'react-native-paper';
import CustomTabBar from "../../components/Tabbar/CustomTabBar";
type Props = {
navigation: Object,
@ -40,7 +41,7 @@ export default class ProximoAboutScreen extends React.Component<Props> {
<Paragraph>18h30 - 19h30</Paragraph>
</Card.Content>
</Card>
<Card style={{margin: 5}}>
<Card style={{margin: 5, marginBottom: CustomTabBar.TAB_BAR_HEIGHT + 20}}>
<Card.Title
title={i18n.t('proximoScreen.paymentMethods')}
left={props => <List.Icon {...props} icon={'cash'}/>}

View file

@ -4,6 +4,7 @@ import * as React from 'react';
import {Image, ScrollView, View} from 'react-native';
import i18n from "i18n-js";
import {Card, List, Paragraph, Text, Title} from 'react-native-paper';
import CustomTabBar from "../../components/Tabbar/CustomTabBar";
type Props = {
navigation: Object,
@ -67,7 +68,7 @@ export default class ProxiwashAboutScreen extends React.Component<Props> {
<Paragraph>{i18n.t('proxiwashScreen.dryersTariff')}</Paragraph>
</Card.Content>
</Card>
<Card style={{margin: 5}}>
<Card style={{margin: 5, marginBottom: CustomTabBar.TAB_BAR_HEIGHT + 20}}>
<Card.Title
title={i18n.t('proxiwashScreen.paymentMethods')}
left={props => <List.Icon {...props} icon={'cash'}/>}

View file

@ -9,6 +9,7 @@ import URLHandler from "../utils/URLHandler";
import {Linking} from "expo";
import AlertDialog from "../components/Dialog/AlertDialog";
import i18n from 'i18n-js';
import CustomTabBar from "../components/Tabbar/CustomTabBar";
type Props = {};
type State = {
@ -141,25 +142,30 @@ class ScannerScreen extends React.Component<Props, State> {
render() {
return (
<View style={styles.container}>
{this.state.hasPermission
? this.getScanner()
: this.getPermissionScreen()
}
<View style={{
...styles.container,
marginBottom: CustomTabBar.TAB_BAR_HEIGHT + 20
}}>
{this.state.hasPermission
? this.getScanner()
: this.getPermissionScreen()
}
<View style={{height: 50}}>
<Button
icon="information"
mode="contained"
onPress={this.showHelpDialog}
style={styles.button}
>
{i18n.t("scannerScreen.helpButton")}
</Button>
</View>
<AlertDialog
visible={this.state.dialogVisible}
onDismiss={this.onDialogDismiss}
title={this.state.dialogTitle}
message={this.state.dialogMessage}
/>
<Button
icon="information"
mode="contained"
onPress={this.showHelpDialog}
style={styles.button}
>
{i18n.t("scannerScreen.helpButton")}
</Button>
</View>
);
}
@ -200,8 +206,6 @@ const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#000000' // the rock-solid workaround
},
cameraContainer: {
marginTop: 'auto',