Skip to content

Commit cb53fde

Browse files
authored
refactor(PopoverTitle): rename to PopoverHeader (react-bootstrap#5679)
1 parent ef3cce8 commit cb53fde

13 files changed

+20
-60
lines changed

src/Popover.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from 'react';
33
import PropTypes from 'prop-types';
44
import isRequiredForA11y from 'prop-types-extra/lib/isRequiredForA11y';
55
import { useBootstrapPrefix } from './ThemeProvider';
6-
import PopoverTitle from './PopoverTitle';
6+
import PopoverHeader from './PopoverHeader';
77
import PopoverBody from './PopoverBody';
88
import { ArrowProps, Placement } from './types';
99
import { BsPrefixProps } from './helpers';
@@ -134,7 +134,7 @@ Popover.propTypes = propTypes as any;
134134
Popover.defaultProps = defaultProps;
135135

136136
export default Object.assign(Popover, {
137-
Title: PopoverTitle,
137+
Header: PopoverHeader,
138138
Body: PopoverBody,
139139

140140
// Default popover offset.

src/PopoverHeader.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import createWithBsPrefix from './createWithBsPrefix';
2+
3+
export default createWithBsPrefix('popover-header');

src/PopoverTitle.tsx

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export type { PaginationProps } from './Pagination';
143143
export { default as Popover } from './Popover';
144144
export type { PopoverProps } from './Popover';
145145

146-
export { default as PopoverTitle } from './PopoverTitle';
146+
export { default as PopoverHeader } from './PopoverHeader';
147147
export { default as PopoverBody } from './PopoverBody';
148148
export { default as ProgressBar } from './ProgressBar';
149149
export type { ProgressBarProps } from './ProgressBar';

test/PopoverSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe('Popover', () => {
77
it('Should output a popover title and content', () => {
88
mount(
99
<Popover id="test-popover">
10-
<Popover.Title>Popover title</Popover.Title>
10+
<Popover.Header>Popover title</Popover.Header>
1111
<Popover.Body>
1212
<strong>Popover Content</strong>
1313
</Popover.Body>

tests/simple-types-test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -883,9 +883,9 @@ const MegaComponent = () => (
883883
bsPrefix="popover"
884884
style={style}
885885
>
886-
<Popover.Title as="div" bsPrefix="prefix" style={style}>
886+
<Popover.Header as="div" bsPrefix="prefix" style={style}>
887887
Popover title
888-
</Popover.Title>
888+
</Popover.Header>
889889
<Popover.Body as="div" bsPrefix="prefix" style={style}>
890890
<strong>Popover Content</strong>
891891
</Popover.Body>

www/src/examples/Overlays/PopoverBasic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const popover = (
22
<Popover id="popover-basic">
3-
<Popover.Title as="h3">Popover right</Popover.Title>
3+
<Popover.Header as="h3">Popover right</Popover.Header>
44
<Popover.Body>
55
And here's some <strong>amazing</strong> content. It's very engaging.
66
right?

www/src/examples/Overlays/PopoverContained.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function Example() {
2020
containerPadding={20}
2121
>
2222
<Popover id="popover-contained">
23-
<Popover.Title as="h3">Popover bottom</Popover.Title>
23+
<Popover.Header as="h3">Popover bottom</Popover.Header>
2424
<Popover.Body>
2525
<strong>Holy guacamole!</strong> Check this info.
2626
</Popover.Body>

www/src/examples/Overlays/PopoverPositioned.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
placement={placement}
77
overlay={
88
<Popover id={`popover-positioned-${placement}`}>
9-
<Popover.Title as="h3">{`Popover ${placement}`}</Popover.Title>
9+
<Popover.Header as="h3">{`Popover ${placement}`}</Popover.Header>
1010
<Popover.Body>
1111
<strong>Holy guacamole!</strong> Check this info.
1212
</Popover.Body>

www/src/examples/Overlays/PopoverPositionedScrolling.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const popover = (position) => (
22
<Popover id={`popover-positioned-scrolling-${position}`}>
3-
<Popover.Title as="h3">{`Popover ${position}`}</Popover.Title>
3+
<Popover.Header as="h3">{`Popover ${position}`}</Popover.Header>
44
<Popover.Body>
55
<strong>Holy guacamole!</strong> Check this info.
66
</Popover.Body>

0 commit comments

Comments
 (0)