1
- import React from 'react' ;
2
- import PropTypes from 'prop-types' ;
3
- import classNames from 'classnames' ;
4
-
5
- import { mapToCssModules } from './Shared/helper.js' ;
6
- //
7
- import CCard from './CCard' ;
8
- //import CProgress from './CProgress';
9
- import CCardBody from './CCardBody' ;
10
- //import CCardHeader from './CCardHeader';
11
- //import CCardFooter from './CCardFooter';
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+ import classNames from 'classnames'
4
+ import { mapToCssModules } from './Shared/helper.js'
12
5
13
6
//component - CoreUI / CWidgetSimple
14
-
15
- const CWidgetSimple = props => {
7
+ const CWidgetSimple = props => {
16
8
17
9
const {
18
10
children,
19
11
className,
20
12
cssModule,
21
13
//
22
14
header,
23
- mainText,
24
- color,
25
- variant,
15
+ text,
26
16
...attributes
27
17
} = props ;
28
18
29
- const card = { style : '' , bgColor : '' } ;
30
-
31
- if ( variant === 'inverse' ) {
32
- card . style = 'text-white' ;
33
- card . bgColor = 'bg-' + color ;
34
- }
35
-
36
- const classes = mapToCssModules ( classNames ( className , card . style , card . bgColor ) , cssModule ) ;
19
+ const classes = mapToCssModules ( classNames (
20
+ 'card' , className
21
+ ) , cssModule )
37
22
38
23
return (
39
- < CCard { ...attributes } className = { classes } >
40
- < CCardBody className = "text-center" >
41
- { /*
42
- <CButtonGroup className="float-right">
43
- <CButtonDropdown id='card1' isOpen={this.state.card1} toggle={() => { this.setState({ card1: !this.state.card1 }); }}>
44
- <CDropdownToggle caret className="p-0" color="transparent">
45
- <i className="icon-settings"></i>
46
- </CDropdownToggle>
47
- <CDropdownMenu right>
48
- <CDropdownItem>Action</CDropdownItem>
49
- <CDropdownItem>Another action</CDropdownItem>
50
- <CDropdownItem>Something else here</CDropdownItem>
51
- </CDropdownMenu>
52
- </CButtonDropdown>
53
- </CButtonGroup>
54
- */ }
55
- < div className = "text-muted small text-uppercase font-weight-bold" > { header } </ div >
56
- < div className = "text-value-xl py-3" > { mainText } </ div >
57
- { children }
58
- </ CCardBody >
59
- </ CCard >
60
- ) ;
61
-
24
+ < div className = { classes } { ...attributes } >
25
+ < div className = "card-body text-center" >
26
+ { header && < div className = "text-muted small text-uppercase font-weight-bold" >
27
+ { header } </ div > }
28
+ { text && < div className = "h2 py-3" > { text } </ div > }
29
+ { children }
30
+ </ div >
31
+ </ div >
32
+ )
62
33
}
63
34
64
35
CWidgetSimple . propTypes = {
@@ -68,16 +39,7 @@ CWidgetSimple.propTypes = {
68
39
//
69
40
innerRef : PropTypes . oneOfType ( [ PropTypes . object , PropTypes . func , PropTypes . string ] ) ,
70
41
header : PropTypes . string ,
71
- mainText : PropTypes . string ,
72
- color : PropTypes . string ,
73
- variant : PropTypes . string ,
74
- } ;
75
-
76
- CWidgetSimple . defaultProps = {
77
- header : 'title' ,
78
- mainText : 'text' ,
79
- color : '' ,
80
- variant : '' ,
42
+ text : PropTypes . string
81
43
} ;
82
44
83
- export default CWidgetSimple ;
45
+ export default CWidgetSimple
0 commit comments