meteor-interface
Version:
Simple Content Management System to generate your administration interface for Meteor and React.
93 lines (86 loc) • 2.31 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _semanticUiReact = require("semantic-ui-react");
var _reactSpring = require("react-spring");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// Packages
var ProfileLeftMenu = function ProfileLeftMenu(_ref) {
var _ref$location = _ref.location,
location = _ref$location === void 0 ? {} : _ref$location,
history = _ref.history,
root = _ref.root,
config = _ref.config;
var profilefItem = [{
label: 'Profile',
path: "".concat(root, "/profile"),
icon: 'user'
}, {
label: 'Security',
path: "".concat(root, "/profile/security"),
icon: 'lock'
}, {
label: 'Logout',
path: '',
icon: 'sign out alternate',
action: Meteor.logout
}];
return _react.default.createElement(_reactSpring.Spring, {
from: {
opacity: 0,
marginLeft: -600
},
to: {
opacity: 1,
marginLeft: 0
}
}, function (styles) {
return _react.default.createElement(_semanticUiReact.Menu, {
pointing: true,
fluid: true,
vertical: true,
style: styles,
color: "green"
}, _react.default.createElement(_reactSpring.Transition, {
keys: profilefItem.map(function (item) {
return item.label;
}),
from: {
opacity: 0,
height: 0,
paddingTop: 0,
paddingBottom: 0
},
enter: {
opacity: 1,
height: 40,
paddingTop: 13,
paddingBottom: 13
},
leave: {
opacity: 0,
height: 0,
paddingTop: 0,
paddingBottom: 0
}
}, profilefItem.map(function (item) {
return function (styles) {
return _react.default.createElement(_semanticUiReact.Menu.Item, {
name: item.label,
style: styles,
icon: item.icon,
key: item.label,
active: item.action ? null : location.pathname === item.path,
onClick: item.action ? item.action : function () {
return history.push(item.path);
}
});
};
})));
});
};
var _default = ProfileLeftMenu;
exports.default = _default;