Skip to content

Commit

Permalink
show folder and file icon on asset tree
Browse files Browse the repository at this point in the history
  • Loading branch information
caichi-t committed Oct 10, 2024
1 parent 1a739e7 commit 8873ea3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions web/src/components/atoms/Icon/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
MenuFoldOutlined,
MenuUnfoldOutlined,
FolderOutlined,
FolderOpenOutlined,
LinkOutlined,
UserAddOutlined,
ClearOutlined,
Expand Down Expand Up @@ -137,6 +138,7 @@ export default {
panelToggleLeft: MenuFoldOutlined,
panelToggleRight: MenuUnfoldOutlined,
folder: FolderOutlined,
folderOpen: FolderOpenOutlined,
dot: Dot,
userAdd: UserAddOutlined,
clear: ClearOutlined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@ const UnzipFileList: React.FC<Props> = ({
) : (
treeData && (
<Tree
switcherIcon={<Icon icon="caretDown" />}
switcherIcon={({ expanded }) => (
<SwitcherIcon icon={expanded ? "folderOpen" : "folder"} size={14} />
)}
defaultExpandedKeys={["0-0"]}
selectedKeys={selectedKeys}
onSelect={handleSelect}
treeData={treeData}
multiple={false}
showLine
showLine={{ showLeafIcon: true }}
titleRender={({ title, key, path }) => {
return (
<>
Expand Down Expand Up @@ -144,4 +146,10 @@ const CopyIcon = styled(Icon)`
}
`;

const SwitcherIcon = styled(Icon)`
svg {
transform: none !important;
}
`;

export default UnzipFileList;

0 comments on commit 8873ea3

Please sign in to comment.