Skip to content

Commit c426722

Browse files
committed
move card styles to global theme
1 parent 9c5b252 commit c426722

File tree

11 files changed

+46
-177
lines changed

11 files changed

+46
-177
lines changed

lib/index.js

-8
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,4 @@ export {
2424
Spinner as MKSpinner,
2525
RadioButton as MKRadioButton,
2626
Checkbox as MKCheckbox,
27-
28-
Card as MKCard,
29-
Title as MKCardTitle,
30-
CardImage as MKCardImage,
31-
CardContent as MKCardContent,
32-
CardMenu as MKCardMenu,
33-
CardAction as MKCardAction,
34-
CardStyles as MKCardStyles,
3527
} from './mdl';

lib/mdl/cards/action.js

-16
This file was deleted.

lib/mdl/cards/container.js

-19
This file was deleted.

lib/mdl/cards/content.js

-22
This file was deleted.

lib/mdl/cards/image.js

-15
This file was deleted.

lib/mdl/cards/menu.js

-11
This file was deleted.

lib/mdl/cards/styles.js

-59
This file was deleted.

lib/mdl/cards/title.js

-16
This file was deleted.

lib/mdl/index.js

-7
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,5 @@ exports.Spinner = require('./Spinner');
99
exports.Slider = require('./Slider');
1010
exports.Button = require('./Button');
1111
exports.Ripple = require('./Ripple');
12-
exports.Card = require('./cards/container');
13-
exports.Title = require('./cards/title');
14-
exports.CardImage = require('./cards/image');
15-
exports.CardContent = require('./cards/content');
16-
exports.CardMenu = require('./cards/menu');
17-
exports.CardAction = require('./cards/action');
18-
exports.CardStyles = require('./cards/styles');
1912
exports.RadioButton = require('./RadioButton');
2013
exports.Checkbox = require('./Checkbox');

lib/theme.js

+45
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,51 @@ theme = {
6464
rippleColor: new RGBAttrReference('primaryColorRGB', .2),
6565
inset: 0,
6666
},
67+
cardStyle: {
68+
flex: 1,
69+
backgroundColor: '#ffffff',
70+
borderRadius: 2,
71+
borderColor: '#ffffff',
72+
borderWidth: 1,
73+
shadowColor: 'rgba(0,0,0,.12)',
74+
shadowOpacity: 0.8,
75+
shadowRadius: 2,
76+
shadowOffset: {
77+
height: 1,
78+
width: 2,
79+
},
80+
},
81+
cardImageStyle: {
82+
flex: 1,
83+
height: 170,
84+
resizeMode: 'cover',
85+
},
86+
cardTitleStyle: {
87+
position: 'absolute',
88+
top: 120,
89+
left: 26,
90+
backgroundColor: 'transparent',
91+
padding: 16,
92+
fontSize: 24,
93+
color: '#000000',
94+
fontWeight: 'bold',
95+
},
96+
cardContentStyle: {
97+
padding: 15,
98+
color: 'rgba(0,0,0,.54)',
99+
},
100+
cardActionStyle: {
101+
borderStyle: 'solid',
102+
borderTopColor: 'rgba(0,0,0,.1)',
103+
borderTopWidth: 1,
104+
padding: 15,
105+
},
106+
cardMenuStyle: {
107+
position: 'absolute',
108+
top: 16,
109+
right: 16,
110+
backgroundColor: 'transparent',
111+
},
67112
};
68113

69114
function isPlainObject(o) {

lib/utils.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@ function extractTouchableProps(view) {
8484
return extractProps(view, TouchableWithoutFeedback.propTypes);
8585
}
8686

87-
// Parse stringified color as int
88-
const parseColor = processColor;
89-
9087

9188
// ## Public interface
9289
exports.mergeIntoFast = mergeIntoFast;
@@ -97,4 +94,4 @@ exports.convertCoordinate = convertCoordinate;
9794
exports.getFontSize = getFontSize;
9895
exports.extractProps = extractProps;
9996
exports.extractTouchableProps = extractTouchableProps;
100-
exports.parseColor = parseColor;
97+
exports.parseColor = processColor; // parse stringified color as int

0 commit comments

Comments
 (0)