Skip to content

Commit ea942b8

Browse files
Merge pull request #300 from parallaxinc/card-component
Card component
2 parents 3694509 + fc1027c commit ea942b8

File tree

5 files changed

+41
-8
lines changed

5 files changed

+41
-8
lines changed

src/components/card.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
'use strict';
2+
3+
const _ = require('lodash');
4+
const React = require('react');
5+
6+
const defaultStyle = {
7+
boxShadow: '0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12)',
8+
backgroundColor: 'white',
9+
padding: '16px',
10+
borderRadius: '2px'
11+
};
12+
13+
class Card extends React.Component {
14+
render(){
15+
const {
16+
style = {},
17+
children
18+
} = this.props;
19+
20+
const styles = _.assign({}, defaultStyle, style);
21+
22+
return (
23+
<div style={styles}>
24+
{children}
25+
</div>
26+
);
27+
}
28+
}
29+
30+
module.exports = Card;

src/components/overlay.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
const _ = require('lodash');
44
const React = require('react');
5-
const Card = require('react-material/components/Card');
5+
6+
const Card = require('./card');
67

78
const styles = {
89
overlay: {
@@ -31,7 +32,7 @@ class Overlay extends React.Component {
3132
}
3233

3334
return (
34-
<Card styles={cardStyle}>
35+
<Card style={cardStyle}>
3536
{children}
3637
</Card>
3738
);

src/components/projects-button.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ const { MainButton } = require('react-mfb-iceddev');
66
const styles = {
77
changeFolderButton: {
88
position: 'absolute',
9-
top: -28,
9+
top: 28,
1010
margin: 0,
11-
right: 19,
12-
left: 'auto',
11+
left: 140,
1312
transform: 'none'
1413
}
1514
};

src/components/sidebar.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
'use strict';
22

33
const React = require('react');
4-
const Card = require('react-material/components/Card');
4+
5+
const Card = require('./card');
56

67
const styles = {
78
card: {
@@ -20,7 +21,7 @@ class Sidebar extends React.Component {
2021
} = this.props;
2122

2223
return (
23-
<Card styles={styles.card}>
24+
<Card style={styles.card}>
2425
{children}
2526
</Card>
2627
);

src/views/download-overlay.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ const ProgressBar = require('../components/progress-bar');
1414
const styles = {
1515
overlay: {
1616
paddingBottom: 40,
17-
width: 600
17+
width: 600,
18+
// keep the download progress pinned to the bottom
19+
position: 'relative'
1820
},
1921
overlayFooter: {
2022
marginLeft: 0,

0 commit comments

Comments
 (0)