Skip to content

Commit

Permalink
🔖 0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
a-tokyo committed Jan 4, 2023
1 parent 63c77ad commit f644b8e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-flex-grid",
"version": "0.11.0",
"version": "0.12.0",
"description": "🎨 A react-native flexbox grid similar to bootstap's web grid.",
"main": "node_modules/expo/AppEntry.js",
"module": "lib/module/index.js",
Expand Down
5 changes: 1 addition & 4 deletions scripts/prep-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ const packageJsonFile = editJsonFile('package.json');
// Update `main` field to support npm package instead of expo dev
packageJsonFile.set(
'main',
args[0] === 'expo'
? 'node_modules/expo/AppEntry.js'
: packageJsonFile.data.module?.replace('module', 'commonsjs') ||
'lib/commonjs/index.js',
args[0] === 'expo' ? 'node_modules/expo/AppEntry.js' : 'src/index.ts',
);

// Save file
Expand Down
4 changes: 2 additions & 2 deletions src/components/Layout/Col/Col.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ export declare interface ColProps extends ViewProps {
lgOrder?: number | string;
/** xl order */
xlOrder?: number | string;
/** Element to render */
Element?: React.ElementType;
/** Gutter size -- [Bootstrap Gutters](https://getbootstrap.com/docs/5.0/layout/gutters/) */
gx?: 0 | 1 | 2 | 3 | 4 | 5;
/** Direction */
dir?: 'ltr' | 'rtl';
/** Element to render - defaults to View */
Element?: React.ElementType;
}

/** converts decimal to percent string */
Expand Down
2 changes: 1 addition & 1 deletion src/components/Layout/Container/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export declare interface ContainerProps extends ViewProps {
fluid?: boolean;
/** No Padding */
noPadding?: boolean;
/** Element to render */
/** Element to render - defaults to View */
Element?: React.ElementType;
}

Expand Down
20 changes: 13 additions & 7 deletions src/components/Layout/Row/Row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export declare interface RowProps extends ViewProps {
gx?: 0 | 1 | 2 | 3 | 4 | 5;
/** Direction */
dir?: 'ltr' | 'rtl';
/** Element to render - defaults to View */
Element?: React.ElementType;
}

const styles = StyleSheet.create({
Expand All @@ -21,16 +23,20 @@ const styles = StyleSheet.create({
});

/** Row */
const Row = ({ style, gx = 4, dir = 'ltr', ...rest }: RowProps) => (
<View
const Row = ({
style,
gx = 4,
dir = 'ltr',
Element = View,
...rest
}: RowProps) => (
<Element
style={[
styles.row,
dir === 'rtl' && styles.rtl,
gx
? {
marginHorizontal: (-1 * getConfig().gutters[gx]) / 2,
}
: undefined,
gx && {
marginHorizontal: (-1 * getConfig().gutters[gx]) / 2,
},
style,
]}
{...rest}
Expand Down

0 comments on commit f644b8e

Please sign in to comment.