Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

feat(Loader): add support for SVG animations, update in Teams theme #1097

Merged
merged 15 commits into from
Mar 28, 2019

Conversation

layershifter
Copy link
Member

Fixes #1038.

@codecov
Copy link

codecov bot commented Mar 25, 2019

Codecov Report

Merging #1097 into master will decrease coverage by 0.09%.
The diff coverage is 45.45%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #1097     +/-   ##
=========================================
- Coverage   82.11%   82.02%   -0.1%     
=========================================
  Files         717      720      +3     
  Lines        8584     8605     +21     
  Branches     1169     1169             
=========================================
+ Hits         7049     7058      +9     
- Misses       1518     1530     +12     
  Partials       17       17
Impacted Files Coverage Δ
...themes/teams/components/Loader/loaderSvgDataUrl.ts 100% <100%> (ø)
...kages/react/src/themes/teams/componentVariables.ts 100% <100%> (ø) ⬆️
.../themes/teams/components/Loader/loaderVariables.ts 100% <100%> (ø)
packages/react/src/components/Loader/Loader.tsx 100% <100%> (ø) ⬆️
packages/react/src/themes/teams/componentStyles.ts 100% <100%> (ø) ⬆️
...src/themes/teams/components/Loader/loaderStyles.ts 7.69% <7.69%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7bd7426...34ff8d3. Read the comment docs.

medium: pxToRem(57.6),
large: pxToRem(115.2),
larger: pxToRem(115.2),
largest: pxToRem(115.2),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codepretty can you please provide correct sizes for these elements to make them less magic?

const { visible } = this.state

const svgElement = Box.create(svg, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering whether the better shorthand for the svg would be the Icon component.. Can you elaborate why we are using the Box here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please clarify why it can be Icon? For example, this loader is an extra big SVG:

image

And actually, I don't see any way how spinners below can be used as icons:

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense, I mention icon only because it is an svg

variables: v,
}: ComponentStyleFunctionParam<LoaderProps, LoaderVariables>): ICSSInJSStyle => ({
// Reset existing styles from base theme
animationName: 'none',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish we didn't have to reset here all existing styles from the base theme, but I don't have any other proposal. The styles for the base theme seems reasonable for it's usage

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it's absolutely not funny, but I don't have a better idea now...

return {
...outerAnimation,

':before': {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this works? why we have animations for the svg and the :before? Can we somehow move this to the indicator and the svg accordingly?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this because of the svg that is used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idea with svg slot works fine, but Teams loader requires specific markup, i.e need one more element. Here is match:
image

I'm opened for better idea...

@layershifter layershifter merged commit d0dfe57 into master Mar 28, 2019
@delete-merged-branch delete-merged-branch bot deleted the feat/loader-svg branch March 28, 2019 11:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants