Skip to content

Commit

Permalink
feat: improve file tree
Browse files Browse the repository at this point in the history
  • Loading branch information
pionxzh committed Nov 2, 2023
1 parent c2d7b07 commit b06d0a7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"dockview",
"esmodule",
"fflate",
"githubocto",
"grammarly",
"Gridview",
"heroicons",
Expand Down
3 changes: 2 additions & 1 deletion packages/ide/src/components/FileTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function FileTree() {
index: 'root',
canMove: true,
isFolder: true,
children: Object.keys(items),
children: fileList.map(f => f.name),
data: { type: 'dir', name: 'root', path: '/', children: [] },
canRename: false,
}
Expand Down Expand Up @@ -71,6 +71,7 @@ export function FileTree() {
dataProvider={dataProvider}
getItemTitle={item => item.data.name}
viewState={{}}
canSearch={false}
renderItemTitle={renderItemTitle}
onPrimaryAction={handlePrimaryAction}
onRenameItem={handleRenameItem}
Expand Down
14 changes: 3 additions & 11 deletions packages/ide/src/styles/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,10 @@

--rct-arrow-size: 12px;
--rct-arrow-container-size: 16px;
--rct-arrow-padding: 8px;
--rct-arrow-padding: 4px;
--rct-bar-width: 0; /* disable the bar */
--rct-item-padding: 0px;
--rct-radius: 0px; /* disable the radius */
}

.rct-tree-item-button {
margin-left: calc(-1 * var(--rct-arrow-size) - 8px);
}

.rct-tree-item-arrow {
margin-right: calc(-1 * var(--rct-arrow-container-size) + var(--rct-arrow-padding) + 8px);
--rct-item-padding: 8px;
--rct-radius: 0; /* disable the radius */
}


Expand Down

0 comments on commit b06d0a7

Please sign in to comment.