Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`EuiModalHeaderTitle allows passing any props that EuiTitle accepts 1`] = `
<h1
class="euiTitle euiModalHeader__title emotion-euiTitle-uppercase-s"
>
children
</h1>
`;

exports[`EuiModalHeaderTitle component 1`] = `
<div
class="euiTitle euiModalHeader__title emotion-euiTitle-m"
Expand Down
9 changes: 9 additions & 0 deletions src/components/modal/modal_header_title.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,13 @@ describe('EuiModalHeaderTitle', () => {
);
expect(container.firstChild).toMatchSnapshot();
});

it('allows passing any props that EuiTitle accepts', () => {
const { container } = render(
<EuiModalHeaderTitle size="s" textTransform="uppercase">
children
</EuiModalHeaderTitle>
);
expect(container.firstChild).toMatchSnapshot();
});
});
7 changes: 3 additions & 4 deletions src/components/modal/modal_header_title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@

import React, { FunctionComponent, HTMLAttributes, ElementType } from 'react';
import classnames from 'classnames';
import { CommonProps } from '../common';

import { EuiTitle } from '../title';
import { EuiTitle, EuiTitleProps } from '../title';

export type EuiModalHeaderTitleProps = FunctionComponent<
HTMLAttributes<HTMLHeadingElement> &
CommonProps & {
Omit<EuiTitleProps, 'children'> &
HTMLAttributes<HTMLHeadingElement> & {
/**
* The tag to render. Can be changed to a lower heading
* level like `h2` or a container `div`.
Expand Down
3 changes: 3 additions & 0 deletions upcoming_changelogs/6547.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Bug fixes**

- Fixed `EuiModalHeaderTitle` type errors when passed `EuiTitle` props