admin/fs: special rendering if the whole source is not too long, and the name was not customized
Massimo Melina committed
Mar 19, 2022 at 09:41 UTC
dab6f309de37c5654db03d89e6d969f1fc676606
1 file changed
+3
-2
admin/src/VfsTree.ts
+3
-2
@@ -72,11 +72,12 @@ export default function VfsTree({ id2node }:{ id2node: Map<string, VfsNode> }) {
72
node.default && iconTooltip(Web, "Act as website"),
73
node.masks && iconTooltip(Face, "Masks"),
74
isRoot ? "Home"
75
- : !source?.endsWith(name) ? name
76
- : h('span', {},
75
+ // special rendering if the whole source is not too long, and the name was not customized
76
+ : source?.length! < 45 && source?.endsWith(name) ? h('span', {},
77
h('span', { className:styles.path }, source.slice(0,-name.length)),
78
h('span', {}, source.slice(-name.length)),
79
)
80
+ : name
81
),
82
key: name,
83
collapseIcon: h(ExpandMore, {