@brizy/ui
Version:
React elements in Brizy style
24 lines (23 loc) • 1.19 kB
JavaScript
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
import React from "react";
import { classNames } from "../../classNamesFn";
import { FacebookProvider, Like } from "react-facebook";
export const FacebookButton = (_a) => {
var { appID, lang, className } = _a, props = __rest(_a, ["appID", "lang", "className"]);
const _className = classNames(className)("fb", "fb-like", "fb-styles-button", {
[`fb-styles-button--small-${props.layout}`]: props.size === "small",
});
return (React.createElement("div", { className: _className },
React.createElement(FacebookProvider, { appId: appID, language: lang, key: JSON.stringify({ appID, lang, props }) },
React.createElement(Like, Object.assign({}, props)))));
};