Skip to content

Commit ca7716e

Browse files
committed
fix indentation
1 parent 7cd883e commit ca7716e

File tree

3 files changed

+104
-94
lines changed

3 files changed

+104
-94
lines changed

src/category-view/components/ProposalListing/ProposalListing.js

Lines changed: 81 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -13,101 +13,105 @@ const styles = theme => ({
1313
alignItems: 'center'
1414
},
1515
listingContent: {
16-
padding: theme.spacing.unit,
17-
display: 'flex',
18-
flexDirection: 'column',
19-
width: '100%'
16+
padding: theme.spacing.unit,
17+
display: 'flex',
18+
flexDirection: 'column',
19+
width: '100%'
2020
},
2121
date: {
22-
padding: 3 * theme.spacing.unit,
23-
fontWeight: 600,
24-
textAlign: 'center',
25-
[theme.breakpoints.down('xs')]: {
26-
padding: 2 * theme.spacing.unit
27-
}
22+
padding: 3 * theme.spacing.unit,
23+
fontWeight: 600,
24+
textAlign: 'center',
25+
[theme.breakpoints.down('xs')]: {
26+
padding: 2 * theme.spacing.unit
27+
}
2828
},
2929
actions: {
30-
display: 'flex',
31-
justifyContent: 'flex-end'
30+
display: 'flex',
31+
justifyContent: 'flex-end'
3232
},
3333
button: {
3434
marginLeft: theme.spacing.unit
3535
},
3636
badge: {
37-
marginRight: theme.spacing.unit,
38-
height: '25px'
37+
marginRight: theme.spacing.unit,
38+
height: '25px'
3939
},
4040
description: {
41-
marginTop: '5px',
42-
[theme.breakpoints.down('xs')]: {
43-
lineHeight: '1.4em'
44-
}
41+
marginTop: '5px',
42+
[theme.breakpoints.down('xs')]: {
43+
lineHeight: '1.4em'
44+
}
4545
}
4646
});
4747

4848
class ProposalListing extends Component {
49-
render() {
50-
const { id, date, description, badges, isFollowing, classes, theme, follow, show } = this.props;
51-
const [ year, month, day ] = date.split('-');
52-
53-
return (
54-
<Paper className={classes.listing}>
55-
<Typography className={classes.date}>
56-
{`${day}.${month}`}<br/>{year}
57-
</Typography>
58-
<div className={classes.listingContent}>
59-
<div>
60-
{badges.map((badge, idx) => {
61-
return (
62-
<Chip
63-
key={idx}
64-
label={<Typography>{badge.label}</Typography>}
65-
style={{backgroundColor: badge.color}}
66-
className={classes.badge}
67-
/>
68-
);
69-
})}
70-
</div>
71-
<Typography
72-
variant="body2"
73-
paragraph
74-
className={classes.description}
75-
>
76-
{description}
77-
</Typography>
78-
<div className={classes.actions}>
79-
<Button
80-
variant="raised"
81-
color="primary"
82-
onClick={() => show(id)}
83-
>
84-
Timeline
85-
</Button>
86-
{isFollowing ? null :
87-
<Button
88-
variant="raised"
89-
color="secondary"
90-
className={classes.button}
91-
onClick={() => follow(id)}
92-
>
93-
Urmareste
94-
</Button>
95-
}
96-
</div>
97-
</div>
98-
</Paper>
99-
);
100-
}
49+
render() {
50+
const {
51+
id,
52+
date,
53+
description,
54+
badges,
55+
isFollowing,
56+
classes,
57+
theme,
58+
follow,
59+
show
60+
} = this.props;
61+
const [year, month, day] = date.split('-');
62+
63+
return (
64+
<Paper className={classes.listing}>
65+
<Typography className={classes.date}>
66+
{`${day}.${month}`}
67+
<br />
68+
{year}
69+
</Typography>
70+
<div className={classes.listingContent}>
71+
<div>
72+
{badges.map((badge, idx) => {
73+
return (
74+
<Chip
75+
key={idx}
76+
label={<Typography>{badge.label}</Typography>}
77+
style={{ backgroundColor: badge.color }}
78+
className={classes.badge}
79+
/>
80+
);
81+
})}
82+
</div>
83+
<Typography variant="body2" paragraph className={classes.description}>
84+
{description}
85+
</Typography>
86+
<div className={classes.actions}>
87+
<Button variant="raised" color="primary" onClick={() => show(id)}>
88+
Timeline
89+
</Button>
90+
{isFollowing ? null : (
91+
<Button
92+
variant="raised"
93+
color="secondary"
94+
className={classes.button}
95+
onClick={() => follow(id)}
96+
>
97+
Urmareste
98+
</Button>
99+
)}
100+
</div>
101+
</div>
102+
</Paper>
103+
);
104+
}
101105
}
102106

103107
ProposalListing.propTypes = {
104-
id: PropTypes.number.isRequired,
105-
date: PropTypes.string.isRequired,
106-
description: PropTypes.string.isRequired,
107-
badges: PropTypes.arrayOf(PropTypes.object).isRequired,
108-
isFollowing: PropTypes.bool.isRequired,
109-
follow: PropTypes.func.isRequired,
110-
show: PropTypes.func.isRequired
108+
id: PropTypes.number.isRequired,
109+
date: PropTypes.string.isRequired,
110+
description: PropTypes.string.isRequired,
111+
badges: PropTypes.arrayOf(PropTypes.object).isRequired,
112+
isFollowing: PropTypes.bool.isRequired,
113+
follow: PropTypes.func.isRequired,
114+
show: PropTypes.func.isRequired
111115
};
112116

113117
export default withStyles(styles, { withTheme: true })(ProposalListing);

src/category-view/components/ProposalListing/ProposalListing.stories.js

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,25 @@ import { linkTo } from '@storybook/addon-links';
77
import ProposalListing from './ProposalListing';
88

99
const props = {
10-
id: 1234,
11-
date: '2018-04-10',
12-
description: 'Propunere de lege pentru ratificarea Tratatului intre Romania si Republica Federativa a Braziliei',
13-
badges: [
14-
{
15-
label: 'Senat',
16-
color: 'lightpink'
17-
},
18-
{
19-
label: 'Pe ordinea de zi',
20-
color: 'lightblue'
21-
}],
22-
isFollowing: false,
23-
follow: action('follow proposal'),
24-
show: action('show proposal')
10+
id: 1234,
11+
date: '2018-04-10',
12+
description:
13+
'Propunere de lege pentru ratificarea Tratatului intre Romania si Republica Federativa a Braziliei',
14+
badges: [
15+
{
16+
label: 'Senat',
17+
color: 'lightpink'
18+
},
19+
{
20+
label: 'Pe ordinea de zi',
21+
color: 'lightblue'
22+
}
23+
],
24+
isFollowing: false,
25+
follow: action('follow proposal'),
26+
show: action('show proposal')
2527
};
2628

27-
storiesOf('Category View', module).add('ProposalListing', () => <ProposalListing {...props} />);
29+
storiesOf('Category View', module).add('ProposalListing', () => (
30+
<ProposalListing {...props} />
31+
));

src/category-view/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export { default as ProposalListing } from './components/ProposalListing/ProposalListing';
1+
export {
2+
default as ProposalListing
3+
} from './components/ProposalListing/ProposalListing';

0 commit comments

Comments
 (0)