Display plugin version for installed plugins

This commit is contained in:
Florian Scholdei
2020-04-03 00:21:26 +02:00
parent 5e03611e1b
commit 8a2be4a5d3
3 changed files with 1639 additions and 1599 deletions

View File

@@ -68,6 +68,14 @@ const ContentRight = styled.div`
margin-left: auto; margin-left: auto;
`; `;
const RightMarginDiv = styled.div`
margin-right: 0.5rem;
`;
const InheritFlexShrinkDiv = styled.div`
flex-shrink: inherit;
`;
export default class CardColumn extends React.Component<Props> { export default class CardColumn extends React.Component<Props> {
createLink = () => { createLink = () => {
const { link, action } = this.props; const { link, action } = this.props;
@@ -105,8 +113,10 @@ export default class CardColumn extends React.Component<Props> {
<ContentRight>{contentRight}</ContentRight> <ContentRight>{contentRight}</ContentRight>
</div> </div>
<FooterWrapper className={classNames("level", "is-flex")}> <FooterWrapper className={classNames("level", "is-flex")}>
<div className="level-left is-hidden-mobile">{footerLeft}</div> <RightMarginDiv className="level-left is-hidden-mobile">{footerLeft}</RightMarginDiv>
<div className="level-right is-mobile is-marginless">{footerRight}</div> <InheritFlexShrinkDiv className="level-right is-block is-mobile is-marginless shorten-text">
{footerRight}
</InheritFlexShrinkDiv>
</FooterWrapper> </FooterWrapper>
</FlexFullHeight> </FlexFullHeight>
</NoEventWrapper> </NoEventWrapper>

View File

@@ -87,8 +87,15 @@ class PluginEntry extends React.Component<Props, State> {
}); });
}; };
createFooterLeft = (plugin: Plugin) => {
if (!this.isInstallable()) {
return <small>{plugin.version}</small>;
}
return null;
};
createFooterRight = (plugin: Plugin) => { createFooterRight = (plugin: Plugin) => {
return <small className="level-item">{plugin.author}</small>; return <small className="level-item is-block shorten-text">{plugin.author}</small>;
}; };
isInstallable = () => { isInstallable = () => {
@@ -172,8 +179,8 @@ class PluginEntry extends React.Component<Props, State> {
const { plugin } = this.props; const { plugin } = this.props;
const avatar = this.createAvatar(plugin); const avatar = this.createAvatar(plugin);
const actionbar = this.createActionbar(); const actionbar = this.createActionbar();
const footerLeft = this.createFooterLeft(plugin);
const footerRight = this.createFooterRight(plugin); const footerRight = this.createFooterRight(plugin);
const modal = this.renderModal(); const modal = this.renderModal();
return ( return (
@@ -184,6 +191,7 @@ class PluginEntry extends React.Component<Props, State> {
title={plugin.displayName ? <strong>{plugin.displayName}</strong> : <strong>{plugin.name}</strong>} title={plugin.displayName ? <strong>{plugin.displayName}</strong> : <strong>{plugin.name}</strong>}
description={plugin.description} description={plugin.description}
contentRight={plugin.pending || plugin.markedForUninstall ? this.createPendingSpinner() : actionbar} contentRight={plugin.pending || plugin.markedForUninstall ? this.createPendingSpinner() : actionbar}
footerLeft={footerLeft}
footerRight={footerRight} footerRight={footerRight}
/> />
{modal} {modal}

3212
yarn.lock

File diff suppressed because it is too large Load Diff