fix: align submodule items in tree

This commit is contained in:
EnixCoda 2019-12-26 16:40:52 +08:00
parent e33f270f1a
commit aedf3b295c
No known key found for this signature in database
GPG key ID: FE06F5DFC1C9B8E4
2 changed files with 22 additions and 8 deletions

View file

@ -85,7 +85,11 @@ const NodeItemIcon = React.memo(function NodeItemIcon({
if (icons === 'native') return <Icon type={getIconType(node)} />
return (
<>
<Icon placeholder={node.type !== 'tree'} type={getIconType(node)} />
<Icon
className={'node-item-type-icon'}
placeholder={node.type !== 'tree'}
type={getIconType(node)}
/>
{node.type === 'commit' ? (
<Icon type={getIconType(node)} />
) : (

View file

@ -358,12 +358,25 @@
transition: all 0.5s ease;
white-space: nowrap;
&-icon {
.icon-size() {
width: 16px;
height: 16px;
}
&-type-icon {
margin-right: 4px;
.icon-size();
& + .octicon-wrapper,
& + .node-item-icon {
margin-right: 6px;
}
}
&-icon {
.icon-size();
object-fit: contain;
vertical-align: text-bottom;
padding-left: 4px;
box-sizing: content-box;
&.dim {
@ -379,12 +392,9 @@
.node-item-label {
overflow: hidden;
text-overflow: ellipsis;
.node-item-name {
padding-left: 6px;
}
}
.node-item:hover .node-item-name {
&:hover .node-item-name {
text-decoration: underline;
}