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

fix(doc): Use correct LTR/RTL Fela renderer in renderComponent #34

Merged
merged 4 commits into from
Aug 1, 2018

Conversation

miroslavstastny
Copy link
Member

@miroslavstastny miroslavstastny commented Aug 1, 2018

fixes #24

RTL component preview in Docs

When component preview in Docs is switched to RTL, two things happen:

  1. the component is wrapped by <div dir="rtl">.
  2. Fela renderer with RTL plugin is used.

The problem was that getClasses() used hardcoded LTR Fela renderer regardless the switch.
Now renderer is added to fela theme and getClasses() uses the renderer from the theme (via context).

TODO

  • Update the CHANGELOG.md

@codecov
Copy link

codecov bot commented Aug 1, 2018

Codecov Report

Merging #34 into master will decrease coverage by 0.02%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #34      +/-   ##
==========================================
- Coverage   82.86%   82.84%   -0.03%     
==========================================
  Files          59       59              
  Lines         846      845       -1     
  Branches      183      182       -1     
==========================================
- Hits          701      700       -1     
  Misses        141      141              
  Partials        4        4
Impacted Files Coverage Δ
src/components/Provider/Provider.tsx 51.21% <66.66%> (-1.17%) ⬇️

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 403574e...8f095ad. Read the comment docs.

@@ -36,22 +36,26 @@ class Provider extends Component<any, any> {

static Consumer = ProviderConsumer

renderStaticStyles = felaRenderer => {
renderStaticStyles = () => {
// RTL WARNING
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe it would be a good idea to include reference on docs where it is stated that

no further processing with plugins will be done for static styles

http://fela.js.org/docs/advanced/StaticStyle.html

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, link added.

@miroslavstastny miroslavstastny merged commit 4dabc1b into master Aug 1, 2018
@miroslavstastny miroslavstastny deleted the fix/doc-fela-rtl branch August 1, 2018 12:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RTL mode does not work properly
2 participants