1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- "use strict";
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _carousel = require("antd/es/carousel");
-
- var _carousel2 = _interopRequireDefault(_carousel);
-
- require("antd/es/carousel/style/css");
-
- var _react = require("react");
-
- var _react2 = _interopRequireDefault(_react);
-
- var _emoji = require("../../emoji");
-
- var _emoji2 = _interopRequireDefault(_emoji);
-
- require("./Emoji.css");
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- // 每页 20 5*4
- // 共 20 * 3 = 60 (实际是 54)
-
- // class Emoji
-
- var Emoji = function Emoji(_ref) {
- var _onClick = _ref.onClick;
-
- var content = [];
- var curPage = [];
- for (var i = 0; i < 115; i++) {
- if (curPage.length < 20) {
- curPage.push(_emoji2.default[i]);
- } else {
- content.push(curPage);
- curPage = [];
- }
- }
- if (curPage.length > 0) {
- content.push(curPage);
- }
- return _react2.default.createElement(
- _carousel2.default,
- null,
- content.map(function (page, index) {
- return _react2.default.createElement(
- "div",
- { key: index, className: "emoji" },
- page.map(function (item, index) {
- return _react2.default.createElement(
- "div",
- { className: "item", key: item.value },
- _react2.default.createElement("span", { className: "helper" }),
- _react2.default.createElement("img", {
- src: "" + _emoji.prefixUrl + item.value + "." + item.ext,
- alt: item.title,
- style: { display: "inline-block" },
- onClick: function onClick() {
- return _onClick(item.title);
- }
- })
- );
- })
- );
- })
- );
- };
-
- exports.default = Emoji;
- //# sourceMappingURL=Emoji.js.map
|