Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add simple tiles component for gallery
  • Loading branch information
mkevins committed Dec 4, 2019
commit d011a6400205454204e0a62504dc358d9e56458e
43 changes: 43 additions & 0 deletions packages/block-library/src/gallery/tiles.native.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* External dependencies
*/
import { View } from 'react-native';

/**
* WordPress dependencies
*/
import { Children } from '@wordpress/element';

function Tiles( props ) {
const {
tilesProps: {
// align,
columns,
// imageCrop,
},
children,
} = props;

return (
<View
style={ {
flexDirection: 'row',
flexWrap: 'wrap',
} }
>
{ Children.map( children, ( child ) => {
return (
<View
style={ {
flex: 1,
flexBasis: ( ( 1 / columns ) * 100 ) + '%',
} }>
{ child }
</View>
);
} ) }
</View>
);
}

export default Tiles;