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

View file

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

View file

@ -7,6 +7,7 @@ import ImageModal from 'react-native-image-modal';
import i18n from "i18n-js"; import i18n from "i18n-js";
import AuthenticatedScreen from "../../../components/Amicale/AuthenticatedScreen"; import AuthenticatedScreen from "../../../components/Amicale/AuthenticatedScreen";
import CustomHTML from "../../../components/Custom/CustomHTML"; import CustomHTML from "../../../components/Custom/CustomHTML";
import CustomTabBar from "../../../components/Tabbar/CustomTabBar";
type Props = { type Props = {
navigation: Object, navigation: Object,
@ -90,7 +91,7 @@ class ClubDisplayScreen extends React.Component<Props, State> {
} }
const hasManagers = resp.length > 0; const hasManagers = resp.length > 0;
return ( return (
<Card style={{marginTop: 10, marginBottom: 10}}> <Card style={{marginTop: 10, marginBottom: CustomTabBar.TAB_BAR_HEIGHT + 20}}>
<Card.Title <Card.Title
title={i18n.t('clubs.managers')} title={i18n.t('clubs.managers')}
subtitle={hasManagers ? i18n.t('clubs.managersSubtitle') : i18n.t('clubs.managersUnavailable')} 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 Autolink from "react-native-autolink";
import MaterialHeaderButtons, {Item} from "../components/Custom/HeaderButton"; import MaterialHeaderButtons, {Item} from "../components/Custom/HeaderButton";
import {Linking} from "expo"; import {Linking} from "expo";
import CustomTabBar from "../components/Tabbar/CustomTabBar";
type Props = { type Props = {
navigation: Object, navigation: Object,
@ -58,7 +59,7 @@ class FeedItemScreen extends React.Component<Props> {
getContent() { getContent() {
const hasImage = this.displayData.full_picture !== '' && this.displayData.full_picture !== undefined; const hasImage = this.displayData.full_picture !== '' && this.displayData.full_picture !== undefined;
return ( return (
<ScrollView style={{margin: 5}}> <ScrollView style={{margin: 5,}}>
<Card.Title <Card.Title
title={NAME_AMICALE} title={NAME_AMICALE}
subtitle={this.date} subtitle={this.date}
@ -77,7 +78,7 @@ class FeedItemScreen extends React.Component<Props> {
uri: this.displayData.full_picture, uri: this.displayData.full_picture,
}} }}
/></View> : null} /></View> : null}
<Card.Content> <Card.Content style={{paddingBottom: CustomTabBar.TAB_BAR_HEIGHT + 20}}>
{this.displayData.message !== undefined ? {this.displayData.message !== undefined ?
<Autolink <Autolink
text={this.displayData.message} text={this.displayData.message}

View file

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

View file

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

View file

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