forked from reactstrap/reactstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCarouselCaption.js
More file actions
32 lines (28 loc) · 840 Bytes
/
Copy pathCarouselCaption.js
File metadata and controls
32 lines (28 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { mapToCssModules } from './utils';
function CarouselCaption(props) {
const { captionHeader, captionText, cssModule, className } = props;
const classes = mapToCssModules(
classNames(className, 'carousel-caption', 'd-none', 'd-md-block'),
cssModule,
);
return (
<div className={classes}>
<h3>{captionHeader}</h3>
<p>{captionText}</p>
</div>
);
}
CarouselCaption.propTypes = {
/** Heading for the caption */
captionHeader: PropTypes.node,
/** Text for caption */
captionText: PropTypes.node.isRequired,
/** Add custom class */
className: PropTypes.string,
/** Change underlying component's CSS base class name */
cssModule: PropTypes.object,
};
export default CarouselCaption;