Skip to content

Commit

Permalink
move card styles to global theme
Browse files Browse the repository at this point in the history
  • Loading branch information
xinthink committed Feb 10, 2016
1 parent 9c5b252 commit c426722
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 177 deletions.
8 changes: 0 additions & 8 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,4 @@ export {
Spinner as MKSpinner,
RadioButton as MKRadioButton,
Checkbox as MKCheckbox,

Card as MKCard,
Title as MKCardTitle,
CardImage as MKCardImage,
CardContent as MKCardContent,
CardMenu as MKCardMenu,
CardAction as MKCardAction,
CardStyles as MKCardStyles,
} from './mdl';
16 changes: 0 additions & 16 deletions lib/mdl/cards/action.js

This file was deleted.

19 changes: 0 additions & 19 deletions lib/mdl/cards/container.js

This file was deleted.

22 changes: 0 additions & 22 deletions lib/mdl/cards/content.js

This file was deleted.

15 changes: 0 additions & 15 deletions lib/mdl/cards/image.js

This file was deleted.

11 changes: 0 additions & 11 deletions lib/mdl/cards/menu.js

This file was deleted.

59 changes: 0 additions & 59 deletions lib/mdl/cards/styles.js

This file was deleted.

16 changes: 0 additions & 16 deletions lib/mdl/cards/title.js

This file was deleted.

7 changes: 0 additions & 7 deletions lib/mdl/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,5 @@ exports.Spinner = require('./Spinner');
exports.Slider = require('./Slider');
exports.Button = require('./Button');
exports.Ripple = require('./Ripple');
exports.Card = require('./cards/container');
exports.Title = require('./cards/title');
exports.CardImage = require('./cards/image');
exports.CardContent = require('./cards/content');
exports.CardMenu = require('./cards/menu');
exports.CardAction = require('./cards/action');
exports.CardStyles = require('./cards/styles');
exports.RadioButton = require('./RadioButton');
exports.Checkbox = require('./Checkbox');
45 changes: 45 additions & 0 deletions lib/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,51 @@ theme = {
rippleColor: new RGBAttrReference('primaryColorRGB', .2),
inset: 0,
},
cardStyle: {
flex: 1,
backgroundColor: '#ffffff',
borderRadius: 2,
borderColor: '#ffffff',
borderWidth: 1,
shadowColor: 'rgba(0,0,0,.12)',
shadowOpacity: 0.8,
shadowRadius: 2,
shadowOffset: {
height: 1,
width: 2,
},
},
cardImageStyle: {
flex: 1,
height: 170,
resizeMode: 'cover',
},
cardTitleStyle: {
position: 'absolute',
top: 120,
left: 26,
backgroundColor: 'transparent',
padding: 16,
fontSize: 24,
color: '#000000',
fontWeight: 'bold',
},
cardContentStyle: {
padding: 15,
color: 'rgba(0,0,0,.54)',
},
cardActionStyle: {
borderStyle: 'solid',
borderTopColor: 'rgba(0,0,0,.1)',
borderTopWidth: 1,
padding: 15,
},
cardMenuStyle: {
position: 'absolute',
top: 16,
right: 16,
backgroundColor: 'transparent',
},
};

function isPlainObject(o) {
Expand Down
5 changes: 1 addition & 4 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ function extractTouchableProps(view) {
return extractProps(view, TouchableWithoutFeedback.propTypes);
}

// Parse stringified color as int
const parseColor = processColor;


// ## Public interface
exports.mergeIntoFast = mergeIntoFast;
Expand All @@ -97,4 +94,4 @@ exports.convertCoordinate = convertCoordinate;
exports.getFontSize = getFontSize;
exports.extractProps = extractProps;
exports.extractTouchableProps = extractTouchableProps;
exports.parseColor = parseColor;
exports.parseColor = processColor; // parse stringified color as int

0 comments on commit c426722

Please sign in to comment.