react-web-native-sketch
Version:
[TODO: We need an overview of how this can be used via npm vs as a local package]
33 lines • 1.64 kB
JavaScript
;
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a;
var React = require("react");
var strings_1 = require("../../utils/strings");
var index_1 = require("../../index");
var View_1 = require("../../primitives/View/View");
var PopoverComponent_1 = require("../PopoverComponent/PopoverComponent");
var index_2 = require("../../index");
var styles = {
button: (_a = {},
_a[index_2.web] = {
boxShadow: '1px 1px 1px lightgrey',
},
_a.fontSize = 10,
_a)
};
var CTableActionsColumn = function (props) {
var actions = props.actions, t = props.t, row = props.row, classes = props.classes;
return (React.createElement(View_1.View, { style: { flexDirection: 'row' } }, actions.length > 0 &&
React.createElement(PopoverComponent_1.PopoverComponent, { actions: actions.map(function (action) { return (__assign({}, action, { title: action.title && t(action.title), titleXs: action.titleXs && t(action.titleXs), onPress: function () { return action.onPress(row); } })); }) },
React.createElement(index_1.Button, { title: t(strings_1.ACTIONS), backgroundColor: 'lightblue', styles: { root: classes.button } }))));
};
exports.TableActionsColumn = index_2.createStyles(styles, 'CTableActionsColumn')(CTableActionsColumn);
//# sourceMappingURL=TableActionsColumn.js.map