-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathavatar.js
81 lines (70 loc) · 2.42 KB
/
avatar.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AvatarGroupItem = exports.AvatarGroup = exports.SquareAvatar = undefined;
var _react = require("react");
var _react2 = _interopRequireDefault(_react);
require("./styles/avatar.css");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var SquareAvatar = exports.SquareAvatar = function SquareAvatar(_ref) {
var src = _ref.src,
height = _ref.height,
width = _ref.width,
_ref$child = _ref.child,
child = _ref$child === undefined ? null : _ref$child,
_ref$alt = _ref.alt,
alt = _ref$alt === undefined ? "Avatar" : _ref$alt;
if (!child) return _react2.default.createElement("img", {
alt: alt,
className: "avatar",
src: src,
width: width,
height: height
});
return _react2.default.createElement(
"div",
{ className: "avatar-parent-child float-left" },
_react2.default.createElement("img", {
className: "avatar",
alt: alt,
src: src,
width: width,
height: height
}),
_react2.default.createElement("img", {
className: "avatar avatar-child",
alt: alt,
src: child,
width: width / 3,
height: height / 3
})
);
};
var AvatarGroup = exports.AvatarGroup = function AvatarGroup(_ref2) {
var children = _ref2.children;
return _react2.default.createElement(
"div",
{ className: "AvatarStack AvatarStack--three-plus" },
_react2.default.createElement(
"div",
{ className: "AvatarStack-body tooltipped tooltipped-se tooltipped-align-left-1" },
children
)
);
};
var AvatarGroupItem = exports.AvatarGroupItem = function AvatarGroupItem(_ref3) {
var src = _ref3.src,
_ref3$alt = _ref3.alt,
alt = _ref3$alt === undefined ? "@avatarItem" : _ref3$alt,
_ref3$height = _ref3.height,
height = _ref3$height === undefined ? "20" : _ref3$height,
_ref3$width = _ref3.width,
width = _ref3$width === undefined ? "20" : _ref3$width;
return _react2.default.createElement("img", { className: "avatar", height: height, width: width, alt: alt, src: src });
};
exports.default = {
Square: SquareAvatar,
Group: AvatarGroup,
GroupItem: AvatarGroupItem
};