UNPKG

mopinion-react-native-sdk

Version:

Collect in-app feedback with Mopinion for React Native. Built fully in React Native for optimal integration with your React Native app.

1 lines 2.23 kB
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=PageContainer;var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _reactNative=require("react-native");var _Progress=_interopRequireDefault(require("./Progress"));var _Branding=_interopRequireDefault(require("./Branding"));var _styles=require("../styles");var _FormContext=require("./FormContext");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["children","style"];var styles=_reactNative.StyleSheet.create({container:{flex:1,paddingBottom:(0,_styles.spacing)(4),flexDirection:'column',justifyContent:'flex-start'},branding:{position:'absolute',bottom:0,left:0,right:0,justifyContent:'center',alignItems:'center'}});function PageContainer(_ref){var _formConfig$propertie,_formConfig$propertie2,_formConfig$propertie3,_formConfig$propertie4,_formConfig$propertie5;var children=_ref.children,_ref$style=_ref.style,style=_ref$style===void 0?[]:_ref$style,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var _useFormContext=(0,_FormContext.useFormContext)(),formConfig=_useFormContext.formConfig,formIsFullySubmitted=_useFormContext.formIsFullySubmitted;var showDotProgress=!formIsFullySubmitted&&((_formConfig$propertie=formConfig.properties)==null?void 0:(_formConfig$propertie2=_formConfig$propertie.advanced)==null?void 0:_formConfig$propertie2.showProgressbar)&&((_formConfig$propertie3=formConfig.properties)==null?void 0:(_formConfig$propertie4=_formConfig$propertie3.advanced)==null?void 0:_formConfig$propertie4.toggleDotview);return(0,_jsxRuntime.jsxs)(_reactNative.View,Object.assign({},props,{style:[styles.container].concat((0,_toConsumableArray2.default)(style)),children:[showDotProgress&&(0,_jsxRuntime.jsx)(_Progress.default,{variant:"dot"}),children,!((_formConfig$propertie5=formConfig.properties)!=null&&_formConfig$propertie5.disable_branding)&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.branding,children:(0,_jsxRuntime.jsx)(_Branding.default,{})})]}));}