@crossed/ui
Version:
A universal & performant styling library for React Native, Next.js & React
33 lines (32 loc) • 874 B
JavaScript
import { jsx } from "react/jsx-runtime";
import Animated from "react-native-reanimated";
import { forwardRef, memo } from "react";
import { composeStyles, inlineStyle } from "@crossed/styled";
import { useFloatingContext } from "./context";
const FloatingContent = memo(
forwardRef(
({ style, animatedStyle, ...props }, ref) => {
const { open } = useFloatingContext();
return open ? /* @__PURE__ */ jsx(
Animated.View,
{
...props,
style: [
composeStyles(
inlineStyle(() => ({ base: { zIndex: 1 } })),
style
).style().style,
animatedStyle
],
ref,
children: props.children
}
) : null;
}
)
);
FloatingContent.displayName = "Floating.Content";
export {
FloatingContent
};
//# sourceMappingURL=Content.js.map