File tree 2 files changed +31
-0
lines changed
2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ import React , { forwardRef , HTMLAttributes } from 'react'
2
+ import PropTypes from 'prop-types'
3
+ import classNames from 'classnames'
4
+
5
+ export interface CCardImageOverlayProps extends HTMLAttributes < HTMLDivElement > {
6
+ /**
7
+ * A string of all className you want applied to the base component. [docs]
8
+ */
9
+ className ?: string
10
+ }
11
+
12
+ export const CCardImageOverlay = forwardRef < HTMLDivElement , CCardImageOverlayProps > (
13
+ ( { children, className, ...rest } , ref ) => {
14
+ const _className = classNames ( 'card-img-overlay' , className )
15
+
16
+ return (
17
+ < div className = { _className } { ...rest } ref = { ref } >
18
+ { children }
19
+ </ div >
20
+ )
21
+ } ,
22
+ )
23
+
24
+ CCardImageOverlay . propTypes = {
25
+ children : PropTypes . node ,
26
+ className : PropTypes . string ,
27
+ }
28
+
29
+ CCardImageOverlay . displayName = 'CCardImageOverlay'
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import { CCardFooter } from './components/card/CCardFooter'
22
22
import { CCardGroup } from './components/card/CCardGroup'
23
23
import { CCardHeader } from './components/card/CCardHeader'
24
24
import { CCardImage } from './components/card/CCardImage'
25
+ import { CCardImageOverlay } from './components/card/CCardImageOverlay'
25
26
import { CCardLink } from './components/card/CCardLink'
26
27
import { CCardSubtitle } from './components/card/CCardSubtitle'
27
28
import { CCardText } from './components/card/CCardText'
@@ -152,6 +153,7 @@ export {
152
153
CCardFooter ,
153
154
CCardHeader ,
154
155
CCardImage ,
156
+ CCardImageOverlay ,
155
157
CCardLink ,
156
158
CCardSubtitle ,
157
159
CCardText ,
You can’t perform that action at this time.
0 commit comments