@fruits-chain/react-native-xiaoshu
Version:
🌈 React Native UI library
45 lines (41 loc) • 879 B
JavaScript
;
import React, { useMemo, memo } from 'react';
import { View } from 'react-native';
import RowContext from "./context.js";
import STYLES from "./style.js";
/**
* Row 布局
* @description 一组单元格。
*/
import { jsx as _jsx } from "react/jsx-runtime";
const Row = ({
gap = 0,
style,
justify,
align,
...restProps
}) => {
const ctx = useMemo(() => ({
gap
}), [gap]);
const rowStyles = [STYLES.row, {
marginHorizontal: -(+gap / 2),
justifyContent: justify,
alignItems: align
}, style
// to test ui
// {
// backgroundColor: '#666',
// },
];
// console.log(-(+gutter / 2));
return /*#__PURE__*/_jsx(RowContext.Provider, {
value: ctx,
children: /*#__PURE__*/_jsx(View, {
...restProps,
style: rowStyles
})
});
};
export default /*#__PURE__*/memo(Row);
//# sourceMappingURL=row.js.map