aboutsummaryrefslogtreecommitdiff
path: root/src/components/common/CenteredView.tsx
blob: 1c5ed399526e251ae8535b07ef87a357379ac45d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import React from 'react';
import {View, StyleSheet, ViewProps} from 'react-native';

interface CenteredViewProps extends ViewProps {}
/**
 * A centered view that grows to its parents size.
 * @param children - children of this component.
 */
const CenteredView: React.FC<CenteredViewProps> = (props) => {
  return (
    <View style={styles.centeredView} {...props}>
      {props.children}
    </View>
  );
};

const styles = StyleSheet.create({
  centeredView: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
});

export default CenteredView;