Skip to content

Commit 3939ec6

Browse files
committed
feat: highlight JSON nodes to distinguish from data-linked subject folders; refs #88
1 parent f74e703 commit 3939ec6

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/components/DatasetDetailPage/FileTree/FileTreeRow.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ const FileTreeRow: React.FC<Props> = ({ node, level, onPreview }) => {
5656
// );
5757
// }
5858
if (node.kind === "folder") {
59-
const isSubject = /^sub-/i.test(node.name); // subject folders only
59+
// const isSubject = /^sub-/i.test(node.name); // subject folders only
60+
const isJson = /\.json$/i.test(node.name); // end with .json only
6061
return (
6162
<>
6263
<Box
@@ -74,15 +75,17 @@ const FileTreeRow: React.FC<Props> = ({ node, level, onPreview }) => {
7475
<Box sx={{ pl: level * 1.25 }}>
7576
<FolderIcon
7677
fontSize="small"
77-
sx={{ color: isSubject ? Colors.purple : Colors.darkPurple }}
78+
sx={{
79+
color: isJson ? Colors.orange : Colors.darkPurple,
80+
}}
7881
/>
7982
</Box>
8083

8184
<Typography
8285
sx={{
83-
fontWeight: 600,
86+
// fontWeight: 600,
8487
flex: 1,
85-
color: isSubject ? Colors.purple : Colors.darkPurple,
88+
color: Colors.darkPurple,
8689
}}
8790
>
8891
{node.name}
@@ -149,7 +152,7 @@ const FileTreeRow: React.FC<Props> = ({ node, level, onPreview }) => {
149152
<Typography
150153
title={node.name}
151154
sx={{
152-
fontWeight: 500,
155+
// fontWeight: 500,
153156
whiteSpace: "nowrap",
154157
overflow: "hidden",
155158
textOverflow: "ellipsis",

0 commit comments

Comments
 (0)