Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(preview): Create new loading components for preview #2498

Merged
merged 3 commits into from
Mar 31, 2021

Conversation

jstoffan
Copy link
Contributor

@jstoffan jstoffan commented Mar 24, 2021

preview-loading-1

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

  • Unit tests

src/components/preview/icons.ts Outdated Show resolved Hide resolved
src/elements/content-preview/PreviewMask.tsx Outdated Show resolved Hide resolved
@jstoffan jstoffan changed the title feat(preview): Update preview loading experience feat(preview): Create new loading components for preview Mar 30, 2021
@jstoffan jstoffan marked this pull request as ready for review March 30, 2021 22:16
@jstoffan jstoffan requested a review from a team as a code owner March 30, 2021 22:16
ConradJChan
ConradJChan previously approved these changes Mar 30, 2021
src/components/preview/PreviewLoadingRing.tsx Outdated Show resolved Hide resolved
@mergify mergify bot merged commit b669d97 into box:master Mar 31, 2021
@jstoffan jstoffan deleted the preview-loading branch April 1, 2021 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants