]> git.localhorst.tv Git - alttp.git/blob - Region.js
b122f17ec1df47bc7c50ab76d060965503e03408
[alttp.git] / Region.js
1 import PropTypes from 'prop-types';
2 import React from 'react';
3
4 const Region = ({ children, name, x, y }) =>
5         <g
6                 className={`region ${name || ''}`}
7                 transform={x || y ? `translate(${x || 0}, ${y || 0})` : undefined}
8         >
9                 {children}
10         </g>;
11
12 Region.propTypes = {
13         children: PropTypes.node,
14         name: PropTypes.string,
15         x: PropTypes.number,
16         y: PropTypes.number,
17 };
18
19 export default Region;