-
Notifications
You must be signed in to change notification settings - Fork 34
/
ItemFooter.js
49 lines (43 loc) · 1.23 KB
/
ItemFooter.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
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { colors } from '@dhis2/ui-core';
import { getId } from './plugin';
import InterpretationsComponent from '@dhis2/d2-ui-interpretations';
const style = {
scrollContainer: {
overflowY: 'auto',
height: '340px',
},
line: {
margin: '-1px 0px 0px',
height: '1px',
border: 'none',
backgroundColor: colors.grey100,
},
};
class ItemFooter extends Component {
render() {
const objectId = getId(this.props.item);
return (
<div className="dashboard-item-footer">
<hr style={style.line} />
<div style={style.scrollContainer}>
<InterpretationsComponent
d2={this.context.d2}
item={this.props.item}
type={this.props.item.type.toLowerCase()}
id={objectId}
appName="dashboard"
/>
</div>
</div>
);
}
}
ItemFooter.contextTypes = {
d2: PropTypes.object.isRequired,
};
ItemFooter.propTypes = {
item: PropTypes.object.isRequired,
};
export default ItemFooter;