@devloops/react-native-variant
Version:
react-native material ui library
2 lines • 2.15 kB
JavaScript
import _extends from"@babel/runtime/helpers/extends";var _jsxFileName="/Users/devloops/Desktop/reactNative/reactNativeMUI/src/Components/AppBar/AppBar.tsx";import React from'react';import{View,StyleSheet,Platform,Animated}from'react-native';import Action from'./Action';import Content from'./Content';import Color from'color';import{elevationShadowStyle}from'../../Helpers/styleGenerator';import SafeAreaView from'react-native-safe-area-view';import{useTheme}from'../../Theming';var AnimatedSafeAreaView=Platform.OS==='web'?Animated.View:Animated.createAnimatedComponent(SafeAreaView);var AppBar=function AppBar(_ref){var varint=_ref.varint,children=_ref.children,subChildren=_ref.subChildren,subChildrenProps=_ref.subChildrenProps,color=_ref.color,_ref$elevation=_ref.elevation,elevation=_ref$elevation===void 0?2:_ref$elevation,theme=_ref.theme;theme=useTheme(theme);color=color||theme.color.primary;var childrens=React.Children.map(children,function(child){return React.cloneElement(child,{color:Color(color).isDark()?'white':'#333'});});var style=StyleSheet.create({container:{flexDirection:'row',alignContent:'center',alignItems:'center',paddingHorizontal:16,paddingVertical:8,minHeight:56,backgroundColor:color,margin:0},root:{justifyContent:'flex-start'}});return React.createElement(AnimatedSafeAreaView,{style:[style.root,elevationShadowStyle(elevation)],__source:{fileName:_jsxFileName,lineNumber:64}},React.createElement(Animated.View,{style:[style.container],__source:{fileName:_jsxFileName,lineNumber:65}},childrens),subChildren&&varint==='top'&&React.createElement(View,{style:[{backgroundColor:color,minHeight:100,justifyContent:'center',paddingLeft:60}],__source:{fileName:_jsxFileName,lineNumber:67}},React.createElement(View,_extends({style:{marginLeft:24,marginRight:16}},subChildrenProps,{__source:{fileName:_jsxFileName,lineNumber:76}}),subChildren())));};var Grow=function Grow(){return React.createElement(View,{style:{flexGrow:1},__source:{fileName:_jsxFileName,lineNumber:85}});};Grow.displayName='Grow';AppBar.Grow=Grow;AppBar.Content=Content;AppBar.Action=Action;export default AppBar;
//# sourceMappingURL=AppBar.js.map