Skip to content

Commit 4dc6a5d

Browse files
cassernilottamus
authored andcommitted
fix: spacing (#21)
* fix: spacing * fix: header spacing
1 parent c29e7b3 commit 4dc6a5d

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

src/components/SchemaRow.tsx

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,30 +50,33 @@ export const SchemaRow: React.FunctionComponent<ISchemaRow> = ({ node, treeStore
5050
<div
5151
className="flex flex-1 items-center text-sm leading-tight w-full h-full relative"
5252
style={{
53-
marginLeft: ICON_DIMENSION * (node.level + 1) + ROW_OFFSET, // offset for spacing
53+
marginLeft: ICON_DIMENSION * node.level, // offset for spacing
5454
}}
5555
>
56-
{node.canHaveChildren && (
57-
<div
58-
className="absolute flex justify-center cursor-pointer p-1 rounded hover:bg-darken-3"
59-
style={{
60-
left: ICON_DIMENSION * -1 + ROW_OFFSET / -2,
61-
width: ICON_DIMENSION,
62-
height: ICON_DIMENSION,
63-
}}
64-
>
65-
<Icon
66-
iconSize={ICON_SIZE}
67-
icon={treeStore.isNodeExpanded(node) ? 'caret-down' : 'caret-right'}
68-
color={Colors.GRAY1}
69-
/>
70-
</div>
71-
)}
56+
{node.canHaveChildren &&
57+
node.level > 0 && (
58+
<div
59+
className="absolute flex justify-center cursor-pointer p-1 rounded hover:bg-darken-3"
60+
style={{
61+
left: ICON_DIMENSION * -1 + ROW_OFFSET / -2,
62+
width: ICON_DIMENSION,
63+
height: ICON_DIMENSION,
64+
}}
65+
>
66+
<Icon
67+
iconSize={ICON_SIZE}
68+
icon={treeStore.isNodeExpanded(node) ? 'caret-down' : 'caret-right'}
69+
color={Colors.GRAY1}
70+
/>
71+
</div>
72+
)}
7273

7374
{schemaNode.divider && (
74-
<div className="flex items-center w-full h-2 absolute" style={{ top: -11, left: -16 }}>
75-
<div className="font-bold text-darken-7 pr-2 uppercase">{schemaNode.divider}</div>
76-
<div className="flex-1 bg-darken-5" style={{ height: 2 }} />
75+
<div className="flex items-center w-full absolute" style={{ top: -9, height: 1 }}>
76+
<div className="font-medium text-darken-7 pr-2 uppercase text-xs" style={{ marginLeft: -10 }}>
77+
{schemaNode.divider}
78+
</div>
79+
<div className="flex-1 bg-darken-5" style={{ height: 1 }} />
7780
</div>
7881
)}
7982

src/components/SchemaTree.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const SchemaTree = observer<ISchemaTree>(props => {
3838
<div className={cn(className, 'flex flex-col h-full w-full')}>
3939
{name &&
4040
!hideTopBar && (
41-
<div className="flex items-center text-sm px-6 font-semibold" style={{ height: 30 }}>
41+
<div className="flex items-center text-sm px-2 font-semibold" style={{ height: 30 }}>
4242
{name}
4343
</div>
4444
)}

0 commit comments

Comments
 (0)