Merge pull request #3028 from saghul/rn-improve-styles
[RN] Simplify absolute fill styles
This commit is contained in:
commit
8ecd6e6ced
|
@ -1,3 +1,5 @@
|
||||||
|
import { StyleSheet } from 'react-native';
|
||||||
|
|
||||||
import { ColorPalette, createStyleSheet } from '../../styles';
|
import { ColorPalette, createStyleSheet } from '../../styles';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,11 +34,7 @@ export const bottomSheetStyles = createStyleSheet({
|
||||||
* view instead, so the modal animation doesn't affect the backdrop.
|
* view instead, so the modal animation doesn't affect the backdrop.
|
||||||
*/
|
*/
|
||||||
backdrop: {
|
backdrop: {
|
||||||
bottom: 0,
|
...StyleSheet.absoluteFillObject
|
||||||
left: 0,
|
|
||||||
position: 'absolute',
|
|
||||||
right: 0,
|
|
||||||
top: 0
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,12 +51,8 @@ export const bottomSheetStyles = createStyleSheet({
|
||||||
* Style for an overlay on top of which the sheet will be displayed.
|
* Style for an overlay on top of which the sheet will be displayed.
|
||||||
*/
|
*/
|
||||||
overlay: {
|
overlay: {
|
||||||
backgroundColor: 'rgba(0, 0, 0, 0.8)',
|
...StyleSheet.absoluteFillObject,
|
||||||
bottom: 0,
|
backgroundColor: 'rgba(0, 0, 0, 0.8)'
|
||||||
left: 0,
|
|
||||||
position: 'absolute',
|
|
||||||
right: 0,
|
|
||||||
top: 0
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { StyleSheet } from 'react-native';
|
||||||
|
|
||||||
import { ColorPalette, createStyleSheet } from '../../styles';
|
import { ColorPalette, createStyleSheet } from '../../styles';
|
||||||
|
|
||||||
export default createStyleSheet({
|
export default createStyleSheet({
|
||||||
|
@ -8,17 +10,13 @@ export default createStyleSheet({
|
||||||
* The style of {@code CalleeInfo}.
|
* The style of {@code CalleeInfo}.
|
||||||
*/
|
*/
|
||||||
ringing: {
|
ringing: {
|
||||||
|
...StyleSheet.absoluteFillObject,
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
backgroundColor: ColorPalette.black,
|
backgroundColor: ColorPalette.black,
|
||||||
bottom: 0,
|
|
||||||
flex: 0,
|
flex: 0,
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
left: 0,
|
opacity: 0.8
|
||||||
opacity: 0.8,
|
|
||||||
position: 'absolute',
|
|
||||||
right: 0,
|
|
||||||
top: 0
|
|
||||||
},
|
},
|
||||||
|
|
||||||
'ringing__avatar': {
|
'ringing__avatar': {
|
||||||
|
|
|
@ -35,11 +35,7 @@ export default StyleSheet.create({
|
||||||
* and create a fade-in effect.
|
* and create a fade-in effect.
|
||||||
*/
|
*/
|
||||||
videoCover: {
|
videoCover: {
|
||||||
backgroundColor: ColorPalette.black,
|
...StyleSheet.absoluteFillObject,
|
||||||
bottom: 0,
|
backgroundColor: ColorPalette.black
|
||||||
left: 0,
|
|
||||||
position: 'absolute',
|
|
||||||
right: 0,
|
|
||||||
top: 0
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { View } from 'react-native';
|
import { StyleSheet, View } from 'react-native';
|
||||||
|
|
||||||
import { ColorPalette } from '../../../styles';
|
import { ColorPalette } from '../../../styles';
|
||||||
|
|
||||||
|
@ -9,13 +9,9 @@ import { ColorPalette } from '../../../styles';
|
||||||
* Base style for the {@code TintedView} component.
|
* Base style for the {@code TintedView} component.
|
||||||
*/
|
*/
|
||||||
const BASE_STYLE = {
|
const BASE_STYLE = {
|
||||||
|
...StyleSheet.absoluteFillObject,
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
bottom: 0,
|
justifyContent: 'center'
|
||||||
justifyContent: 'center',
|
|
||||||
left: 0,
|
|
||||||
position: 'absolute',
|
|
||||||
right: 0,
|
|
||||||
top: 0
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { StyleSheet } from 'react-native';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
BoxModel,
|
BoxModel,
|
||||||
ColorPalette,
|
ColorPalette,
|
||||||
|
@ -47,15 +49,11 @@ const HEADER_STYLES = {
|
||||||
* The top-level element of a page.
|
* The top-level element of a page.
|
||||||
*/
|
*/
|
||||||
page: {
|
page: {
|
||||||
|
...StyleSheet.absoluteFillObject,
|
||||||
alignItems: 'stretch',
|
alignItems: 'stretch',
|
||||||
bottom: 0,
|
|
||||||
flex: 1,
|
flex: 1,
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
left: 0,
|
overflow: 'hidden'
|
||||||
overflow: 'hidden',
|
|
||||||
position: 'absolute',
|
|
||||||
right: 0,
|
|
||||||
top: 0
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { StyleSheet } from 'react-native';
|
||||||
|
|
||||||
import { ColorPalette, createStyleSheet } from '../../base/styles';
|
import { ColorPalette, createStyleSheet } from '../../base/styles';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,14 +12,10 @@ export default createStyleSheet({
|
||||||
* Large video container style.
|
* Large video container style.
|
||||||
*/
|
*/
|
||||||
largeVideo: {
|
largeVideo: {
|
||||||
|
...StyleSheet.absoluteFillObject,
|
||||||
alignItems: 'stretch',
|
alignItems: 'stretch',
|
||||||
backgroundColor: ColorPalette.appBackground,
|
backgroundColor: ColorPalette.appBackground,
|
||||||
bottom: 0,
|
|
||||||
flex: 1,
|
flex: 1,
|
||||||
justifyContent: 'center',
|
justifyContent: 'center'
|
||||||
left: 0,
|
|
||||||
position: 'absolute',
|
|
||||||
right: 0,
|
|
||||||
top: 0
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import React, { Component } from 'react';
|
import React, { Component, type Node } from 'react';
|
||||||
import { View } from 'react-native';
|
import { SafeAreaView } from 'react-native';
|
||||||
|
|
||||||
import { overlayFrame as styles } from './styles';
|
import { overlayFrame as styles } from './styles';
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ type Props = {
|
||||||
/**
|
/**
|
||||||
* The children components to be displayed into the overlay frame.
|
* The children components to be displayed into the overlay frame.
|
||||||
*/
|
*/
|
||||||
children?: React$Node,
|
children: Node,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,13 +24,13 @@ export default class OverlayFrame extends Component<Props> {
|
||||||
* Implements React's {@link Component#render()}.
|
* Implements React's {@link Component#render()}.
|
||||||
*
|
*
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
* @returns {React$Element}
|
* @returns {ReactElement}
|
||||||
*/
|
*/
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<View style = { styles.container }>
|
<SafeAreaView style = { styles.container }>
|
||||||
{ this.props.children }
|
{ this.props.children }
|
||||||
</View>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { StyleSheet } from 'react-native';
|
||||||
|
|
||||||
import { BoxModel, ColorPalette, createStyleSheet } from '../../base/styles';
|
import { BoxModel, ColorPalette, createStyleSheet } from '../../base/styles';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -14,12 +16,8 @@ export const overlayFrame = createStyleSheet({
|
||||||
* rendered.
|
* rendered.
|
||||||
*/
|
*/
|
||||||
container: {
|
container: {
|
||||||
backgroundColor: ColorPalette.red,
|
...StyleSheet.absoluteFillObject,
|
||||||
bottom: 0,
|
backgroundColor: ColorPalette.red
|
||||||
left: 0,
|
|
||||||
position: 'absolute',
|
|
||||||
right: 0,
|
|
||||||
top: 0
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -52,22 +50,16 @@ export const pageReloadOverlay = createStyleSheet({
|
||||||
*/
|
*/
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
marginBottom: BoxModel.margin,
|
margin: BoxModel.margin * 2
|
||||||
marginHorizontal: BoxModel.margin,
|
|
||||||
marginTop: BoxModel.margin * 3
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Style for the {@code LoadingIndicator}.
|
* Style for the {@code LoadingIndicator}.
|
||||||
*/
|
*/
|
||||||
loadingIndicator: {
|
loadingIndicator: {
|
||||||
|
...StyleSheet.absoluteFillObject,
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
bottom: 0,
|
justifyContent: 'center'
|
||||||
justifyContent: 'center',
|
|
||||||
left: 0,
|
|
||||||
position: 'absolute',
|
|
||||||
right: 0,
|
|
||||||
top: 0
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
import { StyleSheet } from 'react-native';
|
||||||
|
|
||||||
import { BoxModel, ColorPalette, createStyleSheet } from '../../../base/styles';
|
import { BoxModel, ColorPalette, createStyleSheet } from '../../../base/styles';
|
||||||
|
|
||||||
|
@ -98,11 +99,7 @@ const styles = createStyleSheet({
|
||||||
* of the screen.
|
* of the screen.
|
||||||
*/
|
*/
|
||||||
toolboxWide: {
|
toolboxWide: {
|
||||||
bottom: 0,
|
...StyleSheet.absoluteFillObject
|
||||||
left: 0,
|
|
||||||
position: 'absolute',
|
|
||||||
right: 0,
|
|
||||||
top: 0
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue