@cantonjs/react-scroll-view
Version:
react scroll component using intersection observer API
42 lines (37 loc) • 1.23 kB
JavaScript
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
import React from 'react';
import PropTypes from 'prop-types';
export default function Arrow(_ref) {
var color = _ref.color,
other = _objectWithoutProperties(_ref, ['color']);
return React.createElement(
'svg',
_extends({
xmlns: 'http://www.w3.org/2000/svg',
viewBox: '0 0 40 40',
width: '32px',
height: '32px'
}, other),
React.createElement('line', {
x1: '20',
y1: '4',
x2: '20',
y2: '32',
strokeLinecap: 'round',
strokeWidth: 3,
stroke: color
}),
React.createElement('polyline', {
points: '10 24 20 34 30 24',
strokeLinecap: 'round',
strokeLinejoin: 'round',
strokeWidth: 3,
fill: 'none',
stroke: color
})
);
}
Arrow.propTypes = {
color: PropTypes.string.isRequired
};