Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

[SourceTree] Replace inline SVG with img tag #5658

Description

@jasonLaster

We recently added beautiful file icons for JS,TS,JSX and other extensions. The issue is that we used inline svgs which are slow when there are hundreds of files.

We should be able to easily convert them to img tags and CSS like what we do for the file icon. When we do i think we'll see a nice perf win

diff --git a/src/components/PrimaryPanes/SourcesTree.js b/src/components/PrimaryPanes/SourcesTree.js
index 0993be8..3747fea 100644
--- a/src/components/PrimaryPanes/SourcesTree.js
+++ b/src/components/PrimaryPanes/SourcesTree.js
@@ -216,7 +216,8 @@ class SourcesTree extends Component<Props, State> {
         ts: "typescript"
       }[getExtension(source)];
       return sourceType ? (
-        <Svg className="source-icon" name={sourceType} />
+        <img className=`${sourceType}` />
+        {/* <Svg className="source-icon" name={sourceType} /> */}
       ) : (
         <img className="file" />
       );

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Jira

    None yet

    Severity

    None yet

    Estimate

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions