This function given an object containing orientation variants as keys, returns the value for the orientation you are
currently. (inspired by Platform.select(...)
)
Return passed value when device in portrait orientation
Return passed value when device in landscape orientation
Example:
import { makeUseStyles } from "react-native-stylex";
import {
orientation,
portraitOrientation,
landscapeOrientation,
} from "react-native-stylex/orientation";
const useStyles = makeUseStyles(() => ({
cell: {
backgroundColor: "red",
...orientation({
portrait: { alignSelf: "flex-start" },
landscape: { alignSelf: "flex-end" },
}),
},
row: {
width: portraitOrientation(100),
},
root: {
...landscapeOrientation({
top: 10,
left: 10,
}),
},
}));