1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

fix: cluster-icon's badge (events-count) is cropped in clusters-menu

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman 2020-07-29 17:08:25 +03:00
parent d9eb7cb28e
commit ec095cac8e
5 changed files with 17 additions and 25 deletions

View File

@ -44,7 +44,7 @@ Allows faster separately re-run some of involved processes:
1. `yarn dev:renderer` compiles electron's renderer part and start watching files
1. `yarn dev-run` runs app in dev-mode and restarts when electron's main process file has changed
## Developer's RTFM recommended list:
## Developer's ~~RTFM~~ recommended list:
- [TypeScript](https://www.typescriptlang.org/docs/home.html) (front-end/back-end)
- [ReactJS](https://reactjs.org/docs/getting-started.html) (front-end, ui)

View File

@ -26,5 +26,6 @@
right: 0;
bottom: 0;
margin: -$padding * 1.5;
font-size: $font-size-small;
}
}

View File

@ -51,7 +51,7 @@ export class ClusterIcon extends React.Component<Props> {
{showErrors && isAdmin && eventCount > 0 && (
<Badge
className={cssNames("events-count", errorClass)}
label={eventCount >= 1000 ? Math.ceil(eventCount / 1000) * 1000 + "+" : eventCount}
label={eventCount >= 1000 ? Math.ceil(eventCount / 1000) + "k+" : eventCount}
/>
)}
{children}

View File

@ -1,4 +1,5 @@
.ClustersMenu {
@include hidden-scrollbar;
$spacing: $padding * 2;
position: relative;
@ -38,17 +39,9 @@
}
}
> .clusters {
@include hidden-scrollbar;
margin-bottom: $spacing !important;
&:empty {
display: none;
}
}
> .add-cluster {
position: relative;
margin-top: $padding;
.Icon {
border-radius: $radius;

View File

@ -103,20 +103,18 @@ export class ClustersMenu extends React.Component<Props> {
</p>
</div>
)}
<div className="clusters flex column gaps">
{clusters.map(cluster => {
return (
<ClusterIcon
key={cluster.id}
showErrors={true}
cluster={cluster}
isActive={cluster.id === clusterStore.activeClusterId}
onClick={() => this.showCluster(cluster.id)}
onContextMenu={() => this.showContextMenu(cluster)}
/>
)
})}
</div>
{clusters.map(cluster => {
return (
<ClusterIcon
key={cluster.id}
showErrors={true}
cluster={cluster}
isActive={cluster.id === clusterStore.activeClusterId}
onClick={() => this.showCluster(cluster.id)}
onContextMenu={() => this.showContextMenu(cluster)}
/>
)
})}
<div className="add-cluster" onClick={this.addCluster}>
<Tooltip targetId="add-cluster-icon">
<Trans>Add Cluster</Trans>