Skip to content

Commit 20a8945

Browse files
committed
fix(fixed cards component): fixed
1 parent 435e1e3 commit 20a8945

File tree

3 files changed

+92
-88
lines changed

3 files changed

+92
-88
lines changed
Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { ButtonProps } from '@bluebase/components';
1+
import { Button, /*ButtonProps*/ } from '@bluebase/components';
22
import React from 'react';
33
import { action } from '@storybook/addon-actions';
4-
import { getComponent } from '@bluebase/core';
4+
// import { getComponent } from '@bluebase/core';
55
import storiesOf from '@bluebase/storybook-addon';
66
import { withInfo } from '@storybook/addon-info';
77
import { withKnobs } from '@storybook/addon-knobs';
88

9-
const Button = getComponent<ButtonProps>('Button');
9+
// const Button = getComponent<ButtonProps>('Button');
1010

1111
const stories = storiesOf('Button', module);
1212

@@ -15,109 +15,109 @@ stories.addDecorator(withKnobs);
1515

1616
stories
1717

18-
.add('Contained Buttons', () => (
19-
<React.Fragment>
20-
<Button variant="contained" onPress={action('button-press')}>
21-
Default
18+
.add('Contained Buttons', () => (
19+
<React.Fragment>
20+
<Button variant="contained" onPress={action('button-press')}>
21+
Default
2222
</Button>
23-
<Button variant="contained" color="primary" onPress={action('button-press')}>
24-
Primary
23+
<Button variant="contained" color="primary" onPress={action('button-press')}>
24+
Primary
2525
</Button>
26-
<Button variant="contained" color="secondary" onPress={action('button-press')}>
27-
Secondary
26+
<Button variant="contained" color="secondary" onPress={action('button-press')}>
27+
Secondary
2828
</Button>
29-
<Button variant="contained" color="secondary" disabled onPress={action('button-press')}>
30-
Disabled
29+
<Button variant="contained" color="secondary" disabled onPress={action('button-press')}>
30+
Disabled
3131
</Button>
32-
<Button variant="contained" onPress={action('button-press')}>
33-
Link
32+
<Button variant="contained" onPress={action('button-press')}>
33+
Link
3434
</Button>
35-
</React.Fragment>
36-
))
35+
</React.Fragment>
36+
))
3737

38-
.add('Text Buttons', () => (
39-
<React.Fragment>
40-
<Button>Default</Button>
41-
<Button color="primary">
42-
Primary
38+
.add('Text Buttons', () => (
39+
<React.Fragment>
40+
<Button>Default</Button>
41+
<Button color="primary">
42+
Primary
4343
</Button>
44-
<Button color="secondary">
45-
Secondary
44+
<Button color="secondary">
45+
Secondary
4646
</Button>
47-
<Button disabled>
48-
Disabled
47+
<Button disabled>
48+
Disabled
4949
</Button>
50-
<Button>
51-
Link
50+
<Button>
51+
Link
5252
</Button>
53-
</React.Fragment>
54-
))
53+
</React.Fragment>
54+
))
5555

56-
.add('Outlined Buttons', () => (
57-
<React.Fragment>
58-
<Button variant="outlined">
59-
Default
56+
.add('Outlined Buttons', () => (
57+
<React.Fragment>
58+
<Button variant="outlined">
59+
Default
6060
</Button>
61-
<Button variant="outlined" color="primary">
62-
Primary
61+
<Button variant="outlined" color="primary">
62+
Primary
6363
</Button>
64-
<Button variant="outlined" color="secondary">
65-
Secondary
64+
<Button variant="outlined" color="secondary">
65+
Secondary
6666
</Button>
67-
<Button variant="outlined" disabled>
68-
Disabled
67+
<Button variant="outlined" disabled>
68+
Disabled
6969
</Button>
70-
<Button variant="outlined">
71-
Link
70+
<Button variant="outlined">
71+
Link
7272
</Button>
73-
</React.Fragment>
74-
))
73+
</React.Fragment>
74+
))
7575

76-
.add('Sizes', () => (
77-
<React.Fragment>
78-
<Button size="small">
79-
Small
76+
.add('Sizes', () => (
77+
<React.Fragment>
78+
<Button size="small">
79+
Small
8080
</Button>
81-
<Button size="medium">
82-
Medium
81+
<Button size="medium">
82+
Medium
8383
</Button>
84-
<Button size="large">
85-
Large
84+
<Button size="large">
85+
Large
8686
</Button>
87-
<Button variant="outlined" size="small" color="primary">
88-
Small
87+
<Button variant="outlined" size="small" color="primary">
88+
Small
8989
</Button>
90-
<Button variant="outlined" size="medium" color="primary">
91-
Medium
90+
<Button variant="outlined" size="medium" color="primary">
91+
Medium
9292
</Button>
93-
<Button variant="outlined" size="large" color="primary">
94-
Large
93+
<Button variant="outlined" size="large" color="primary">
94+
Large
9595
</Button>
96-
<Button variant="contained" size="small" color="primary">
97-
Small
96+
<Button variant="contained" size="small" color="primary">
97+
Small
9898
</Button>
99-
<Button variant="contained" size="medium" color="primary">
100-
Medium
99+
<Button variant="contained" size="medium" color="primary">
100+
Medium
101101
</Button>
102-
<Button variant="contained" size="large" color="primary">
103-
Large
102+
<Button variant="contained" size="large" color="primary">
103+
Large
104104
</Button>
105-
</React.Fragment>
106-
))
105+
</React.Fragment>
106+
))
107107

108108

109-
.add('Width', () => (
110-
<React.Fragment>
111-
<Button color="primary">Normal</Button>
112-
<Button color="primary" fullWidth={true} >Full Width</Button>
113-
</React.Fragment>
114-
))
109+
.add('Width', () => (
110+
<React.Fragment>
111+
<Button color="primary">Normal</Button>
112+
<Button color="primary" fullWidth={true} >Full Width</Button>
113+
</React.Fragment>
114+
))
115115

116116

117-
.add('Title Prop', () => (
118-
<React.Fragment>
119-
<Button color="primary" title="Contained" variant="contained" />
120-
<Button color="secondary" title="Outlined" variant="outlined" />
121-
<Button color="primary" title="Text" variant="text" />
122-
</React.Fragment>
123-
));
117+
.add('Title Prop', () => (
118+
<React.Fragment>
119+
<Button color="primary" title="Contained" variant="contained" />
120+
<Button color="secondary" title="Outlined" variant="outlined" />
121+
<Button color="primary" title="Text" variant="text" />
122+
</React.Fragment>
123+
));
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
import MuiCardMedia from '@material-ui/core/CardMedia';
22
import React from 'react';
33

4-
const CardMedia = (props: any) => {
5-
4+
const CardMedia = () => {
65
return (
6+
<MuiCardMedia
7+
style={{ width: 100, height: 100 }}
8+
src="https://placeholdit.imgix.net/~text?txtsize=33&txt=318%C3%97180&w=318&h=180"
9+
// src={props.src}
10+
/>
11+
);
12+
713

8-
<MuiCardMedia image={props.source}{...props} />
9-
);
1014
};
1115

1216
export { CardMedia };

src/components/Card/_stories_/Card.stories.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import { CardProps, CardActionsProps, CardHeaderProps, CardContentProps, CardCoverProps } from '@bluebase/components';
2+
import { CardProps, CardActionsProps, CardHeaderProps, CardContentProps } from '@bluebase/components';
33
import Avatar from '@material-ui/core/Avatar';
44
import Collapse from '@material-ui/core/Collapse';
55
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
@@ -19,7 +19,7 @@ import { withInfo } from '@storybook/addon-info';
1919
import { withKnobs } from '@storybook/addon-knobs';
2020

2121
const Card = getComponent<CardProps>('Card');
22-
const CardMedia = getComponent<CardCoverProps>('CardMedia');
22+
// const CardMedia = getComponent<CardCoverProps>('CardMedia');
2323
const CardContent = getComponent<CardContentProps>('CardContent');
2424
const CardActions = getComponent<CardActionsProps>('CardActions');
2525
const CardHeader = getComponent<CardHeaderProps>('CardHeader');
@@ -58,11 +58,11 @@ function RecipeReviewCard() {
5858
title="Shrimp and Chorizo Paella"
5959
description="September 14, 2016"
6060
/>
61-
<CardMedia
61+
{/* <CardMedia
6262
63-
source={require('./paella.jpg')}
63+
source="https://placeholdit.imgix.net/~text?txtsize=33&txt=318%C3%97180&w=318&h=180"
6464
// title="Paella dish"
65-
/>
65+
/> */}
6666
<CardContent>
6767
<Typography component="p">
6868
This impressive paella is a perfect party dish and a fun meal to cook together with your

0 commit comments

Comments
 (0)