瀏覽代碼

cleaned code

Pamela Wolf 5 年之前
父節點
當前提交
b35b3ff031
共有 1 個文件被更改,包括 7 次插入15 次删除
  1. 7 15
      inspector/src/components/sceneExplorer/entities/materialTreeItemComponent.tsx

+ 7 - 15
inspector/src/components/sceneExplorer/entities/materialTreeItemComponent.tsx

@@ -20,26 +20,18 @@ export class MaterialTreeItemComponent extends React.Component<IMaterialTreeItem
 
     render() {
 
-        if(this.props.material.getClassName() === "NodeMaterial") { 
-        
-            return (
-                <div className="materialTools">
-                    <TreeItemLabelComponent label={this.props.material.name} onClick={() => this.props.onClick()} icon={faBrush} color="orange" />
-                    {
-                        <ExtensionsComponent target={this.props.material} extensibilityGroups={this.props.extensibilityGroups} />
-                    }
-                    <div className="icon" onClick={() => {(this.props.material as NodeMaterial).edit()}} title="Node Material Editor" color="white">
-                        <FontAwesomeIcon icon={faPen} />
-                    </div>
-                </div>
-            )
-        }
+        const nmeIcon = this.props.material.getClassName() === "NodeMaterial" ?
+            <div className="icon" onClick={() => {(this.props.material as NodeMaterial).edit()}} title="Node Material Editor" color="white">
+            <FontAwesomeIcon icon={faPen} />
+            </div> : null;
+
         return (
             <div className="materialTools">
                 <TreeItemLabelComponent label={this.props.material.name} onClick={() => this.props.onClick()} icon={faBrush} color="orange" />
                 {
-                    <ExtensionsComponent target={this.props.material} extensibilityGroups={this.props.extensibilityGroups} />
+                   <ExtensionsComponent target={this.props.material} extensibilityGroups={this.props.extensibilityGroups} />
                 }
+                {nmeIcon}
             </div>
         )
     }