feat(preview): Create new loading components for preview #2498
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've kept the new code outside of the
/elements/content-preview
directory because I'd like to replace some similar logic in the Preview SDK without creating a component-level circular dependency. I also went through several different options for managing the "primary" color for each file type icon aside from this one:Export the color from each icon component
The icon components are generated from raw SVG assets and the primary color is not programmatically identifiable, so this isn't feasible, unfortunately.
Update the FileIcon components map to include color and icon
Preview doesn't support all of the file types for which we have icons today and uses different icons in some cases. I will raise this possibility with the product team for a future change.
Create central enums and maps for extensions -> file types -> icons -> colors
We should probably do this at some point, since they're currently spread across multiple files as hardcoded values. However, this would be a rather large change affecting many components and is outside the scope of this project.
I'll create a follow-up PR to actually use this component in ContentPreview once I'm able to upgrade the Preview SDK.
Todo