Skip to content

Add Theming #1454

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

Merged
merged 78 commits into from
Oct 10, 2018
Merged

Add Theming #1454

merged 78 commits into from
Oct 10, 2018

Conversation

iRoachie
Copy link
Collaborator

@iRoachie iRoachie commented Oct 10, 2018

Implements #216

Finally, after countless ages, theming is here 🎉!

Not just colours but:

EVERY, SINGLE, PROP

Exports three new utils:

  • ThemeProvider
  • ThemeConsumer
  • withTheme

Preview

kapture 2018-10-09 at 20 57 23

Breaking Changes

This is a massive breaking change, all apps will need up wrap their Top level component with the <ThemeProvider />

@react-native-elements-ci
Copy link
Collaborator

react-native-elements-ci commented Oct 10, 2018

@codecov
Copy link

codecov bot commented Oct 10, 2018

Codecov Report

Merging #1454 into next will increase coverage by 3.49%.
The diff coverage is 93.18%.

Impacted file tree graph

@@            Coverage Diff            @@
##            next    #1454      +/-   ##
=========================================
+ Coverage   71.3%   74.79%   +3.49%     
=========================================
  Files         30       33       +3     
  Lines        568      615      +47     
  Branches      84       88       +4     
=========================================
+ Hits         405      460      +55     
+ Misses       136      132       -4     
+ Partials      27       23       -4
Impacted Files Coverage Δ
src/avatar/Avatar.js 30% <ø> (ø) ⬆️
src/tooltip/Tooltip.js 91.17% <ø> (ø) ⬆️
src/tile/FeaturedTile.js 100% <ø> (ø) ⬆️
src/searchbar/SearchBar-ios.js 61.76% <ø> (ø) ⬆️
src/overlay/Overlay.js 90.9% <ø> (ø) ⬆️
src/social/SocialIcon.js 91.66% <ø> (ø) ⬆️
src/searchbar/SearchBar-android.js 66.66% <ø> (+3.03%) ⬆️
src/rating/Rating.js 80% <ø> (ø) ⬆️
src/icons/Icon.js 100% <ø> (ø) ⬆️
src/config/index.js 100% <100%> (ø)
... and 25 more

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 78f961f...a5dce79. Read the comment docs.

@Monte9 Monte9 self-assigned this Oct 10, 2018
@Monte9 Monte9 self-requested a review October 10, 2018 01:25
Copy link
Collaborator

@xavier-villelegier xavier-villelegier left a comment

Choose a reason for hiding this comment

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

omg 😱That's definitely a killer feature ! We can custom so many things 😍
Also the tests are amazing 👏

...attributes
} = props;

if (element) return element;

let childElement = (
<Text style={[styles.text, textStyle && textStyle]}>{value}</Text>
<Text style={StyleSheet.flatten([styles.text, textStyle && textStyle])}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Finally !! 👏 We should have flattened all styles a while ago.

@Gregjarvez
Copy link
Collaborator

this is so awesome !

@iRoachie
Copy link
Collaborator Author

Alright! ThemeProvider now optional if you don't want theming. That's means no more breaking change!

@Monte9
Copy link
Collaborator

Monte9 commented Oct 10, 2018

@iRoachie yes!! that's huge! Thanks for putting in the extra work to make that possible, I know a lot of users would appreciate that.

@iRoachie iRoachie merged commit e9750c8 into next Oct 10, 2018
@iRoachie iRoachie deleted the theme branch October 10, 2018 20:26
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.

5 participants