@crossed/ui
Version:
A universal & performant styling library for React Native, Next.js & React
47 lines (46 loc) • 1.11 kB
JavaScript
import { jsx, jsxs } from "react/jsx-runtime";
import Animated, { FadeIn } from "react-native-reanimated";
import { composeStyles, createStyles } from "@crossed/styled";
const styles = createStyles(() => ({
stickyFooter: {
base: { position: "absolute", right: 0, left: 0, bottom: 0 }
},
paddingRightDyn: (paddingRight) => ({ paddingRight })
}));
const Layout = ({
footer,
showFooter,
stickyFooter,
style,
children,
paddingRight,
animatedStyle,
...rest
}) => {
return /* @__PURE__ */ jsxs(
Animated.View,
{
...rest,
style: [composeStyles(style).rnw().style, animatedStyle],
children: [
children,
stickyFooter && showFooter && /* @__PURE__ */ jsx(
Animated.View,
{
entering: FadeIn.duration(0),
style: composeStyles(
styles.stickyFooter,
styles.paddingRightDyn(paddingRight)
).style().style,
testID: "stickyFooter",
children: footer
}
)
]
}
);
};
export {
Layout
};
//# sourceMappingURL=Layout.js.map