import { ScrollView, StyleSheet, View } from 'react-native'
import React from 'react'
import { screens } from '../theme'

const Screen = ({ children, scrollable }) => {
  if (scrollable) {
    return (
      <ScrollView showsVerticalScrollIndicator={false} style={styles.screen}>
        {children}
      </ScrollView>
    )
  }
  return <View style={styles.screen}>{children}</View>
}

export default Screen

const styles = StyleSheet.create({
  screen: {
    flex: 1,
    backgroundColor: '#fff',
    paddingHorizontal: screens.paddingHorizontal,
    paddingVertical: screens.paddingVertical,
    marginHorizontal: screens.marginHorizontal,
    marginVertical: screens.marginVertical,
  },
})
