-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(SceneHierarchyPerformance): SceneHierarchy Tree Performance (#283)
- Reduces the number of rerenders significantly in the SceneHierarchy Tree view whenever actions like activating, selecting and removing happen - Removes redundent On2 loop when computing children for a scene hierarchy node - Cleans up some new responsibilities for TreeItem and Tree Label that were added in the wrong places. Co-authored-by: Mitchell Lee <mitchlee@amazon.com>
- Loading branch information
1 parent
d533a8c
commit 1a16eb4
Showing
10 changed files
with
368 additions
and
399 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...components/panels/SceneHierarchyPanel/components/SceneHierarchyTree/ComponentTypeIcon.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from 'react'; | ||
import { Icon } from '@awsui/components-react'; | ||
|
||
import { Camera, Light, Modelref, Tag } from '../../../../../assets/auto-gen/icons'; | ||
import { KnownComponentType } from '../../../../../interfaces'; | ||
|
||
const ComponentTypeIcon = ({ type, ...props }: { type: string }) => { | ||
switch (type) { | ||
case KnownComponentType.Camera: | ||
return <Icon svg={<Camera {...props} />} />; | ||
case KnownComponentType.Light: | ||
return <Icon svg={<Light {...props} />} />; | ||
case KnownComponentType.ModelRef: | ||
case KnownComponentType.SubModelRef: | ||
return <Icon svg={<Modelref {...props} />} />; | ||
case KnownComponentType.Tag: | ||
return <Icon svg={<Tag {...props} />} />; | ||
default: | ||
return <></>; | ||
} | ||
}; | ||
|
||
ComponentTypeIcon.displayName = ComponentTypeIcon; | ||
|
||
export default ComponentTypeIcon; |
Oops, something went wrong.