Use l10n ids in extension chip

This commit is contained in:
Connor Hudson 2018-06-22 10:01:12 -04:00
parent af1cf6bf6e
commit 80dfaa6a1e
2 changed files with 8 additions and 2 deletions

View file

@ -1,6 +1,7 @@
const classNames = require('classnames');
const React = require('react');
const PropTypes = require('prop-types');
const FormattedMessage = require('react-intl').FormattedMessage;
require('./extension-chip.scss');
const ExtensionChip = props => (
@ -12,7 +13,10 @@ const ExtensionChip = props => (
/>
}
<div className="extension-content">
<span>{props.extensionName}</span>
{props.extensionL10n ?
<FormattedMessage id={props.extensionL10n} /> :
<span>{props.extensionName}</span>
}
{props.hasStatus && (
<div className="extension-status">
Needs Connection
@ -23,6 +27,7 @@ const ExtensionChip = props => (
);
ExtensionChip.propTypes = {
extensionL10n: PropTypes.string,
extensionName: PropTypes.string,
hasStatus: PropTypes.bool,
iconURI: PropTypes.string

View file

@ -268,10 +268,11 @@ const PreviewPresentation = ({
<FlexRow className="extension-list">
{extensions && extensions.map(extension => (
<ExtensionChip
extensionL10n={extension.l10nId}
extensionName={extension.name}
hasStatus={extension.hasStatus}
iconURI={extension.icon && `/svgs/project/${extension.icon}`}
key={extension.name}
key={extension.name || extension.l10nId}
/>
))}
</FlexRow>