Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import { getLicense, getExpirationDateFormatted, isExpired } from '../../../stor

const mapStateToProps = (state) => {
const { isActive, type } = getLicense(state);
const typeTitleCase = type.charAt(0).toUpperCase() + type.substr(1).toLowerCase();
return {
status: isActive ? 'Active' : 'Inactive',
type: typeTitleCase,
type,
isExpired: isExpired(state),
expiryDate: getExpirationDateFormatted(state)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
export class LicenseStatus extends React.PureComponent {
render() {
const { isExpired, status, type, expiryDate } = this.props;
const typeTitleCase = type.charAt(0).toUpperCase() + type.substr(1).toLowerCase();
let icon;
let title;
let message;
Expand All @@ -28,7 +29,7 @@ export class LicenseStatus extends React.PureComponent {
Your license expired on <strong>{expiryDate}</strong>
</Fragment>
);
title = `Your ${type} license has expired`;
title = `Your ${typeTitleCase} license has expired`;
} else {
icon = <EuiIcon color="success" type="checkInCircleFilled" />;
message = expiryDate ? (
Expand All @@ -38,7 +39,7 @@ export class LicenseStatus extends React.PureComponent {
) : (
<Fragment>Your license will never expire.</Fragment>
);
title = `Your ${type} license is ${status.toLowerCase()}`;
title = `Your ${typeTitleCase} license is ${status.toLowerCase()}`;
}
return (
<div>
Expand Down