react-facebook-next
Version:
Facebook components like a Login button, Like, Share, Comments or Embedded Post
85 lines (74 loc) • 3.21 kB
JavaScript
import _extends from 'babel-runtime/helpers/extends';
import _regeneratorRuntime from 'babel-runtime/regenerator';
import _asyncToGenerator from 'babel-runtime/helpers/asyncToGenerator';
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
import _inherits from 'babel-runtime/helpers/inherits';
var _class, _temp;
import PropTypes from 'prop-types';
import getCurrentHref from './utils/getCurrentHref';
import clearUndefinedProperties from './utils/clearUndefinedProperties';
import Process from './Process';
var Feed = (_temp = _class = function (_Process) {
_inherits(Feed, _Process);
function Feed() {
_classCallCheck(this, Feed);
return _possibleConstructorReturn(this, _Process.apply(this, arguments));
}
Feed.prototype.process = function () {
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(facebook) {
var _props, _props$link, link, display, _props$appId, appId, redirectURI, from, to, picture, source, name, caption, description, ref;
return _regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_props = this.props, _props$link = _props.link, link = _props$link === undefined ? getCurrentHref() : _props$link, display = _props.display, _props$appId = _props.appId, appId = _props$appId === undefined ? facebook.getAppId() : _props$appId, redirectURI = _props.redirectURI, from = _props.from, to = _props.to, picture = _props.picture, source = _props.source, name = _props.name, caption = _props.caption, description = _props.description, ref = _props.ref;
return _context.abrupt('return', facebook.ui(clearUndefinedProperties({
method: 'feed',
link: link,
display: display,
app_id: appId,
redirect_uri: redirectURI,
from: from,
to: to,
picture: picture,
source: source,
name: name,
caption: caption,
description: description,
ref: ref
})));
case 2:
case 'end':
return _context.stop();
}
}
}, _callee, this);
}));
function process(_x) {
return _ref.apply(this, arguments);
}
return process;
}();
return Feed;
}(Process), _class.propTypes = _extends({}, Process.propTypes, {
appId: PropTypes.string,
redirectURI: PropTypes.string,
display: PropTypes.string,
from: PropTypes.string,
to: PropTypes.string,
link: PropTypes.string,
source: PropTypes.string,
picture: PropTypes.string, // deprecated
name: PropTypes.string, // deprecated
caption: PropTypes.string, // deprecated
description: PropTypes.string, // deprecated
ref: PropTypes.string
}), _class.defaultProps = _extends({}, Process.defaultProps, {
link: undefined,
display: undefined,
appId: undefined,
redirectURI: undefined
}), _temp);
export { Feed as default };
//# sourceMappingURL=Feed.js.map