-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Modal): Convert Modal component to typescript
- Loading branch information
1 parent
c92e603
commit 2fce11a
Showing
43 changed files
with
899 additions
and
818 deletions.
There are no files selected for viewing
18 changes: 0 additions & 18 deletions
18
packages/patternfly-4/react-core/src/components/Modal/Modal.d.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
packages/patternfly-4/react-core/src/components/Modal/ModalBox.d.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
packages/patternfly-4/react-core/src/components/Modal/ModalBoxBody.d.ts
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
packages/patternfly-4/react-core/src/components/Modal/ModalBoxBody.js
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
...src/components/Modal/ModalBoxBody.test.js → ...rc/components/Modal/ModalBoxBody.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import ModalBoxBody from './ModalBoxBody'; | ||
import React from 'react'; | ||
import * as React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
|
||
test('ModalBoxBody Test', () => { | ||
const view = shallow(<ModalBoxBody id="id">This is a ModalBox header</ModalBoxBody>); | ||
const view = shallow(<ModalBoxBody id="id" className="test-box-class">This is a ModalBox header</ModalBoxBody>); | ||
expect(view).toMatchSnapshot(); | ||
}); |
22 changes: 22 additions & 0 deletions
22
packages/patternfly-4/react-core/src/components/Modal/ModalBoxBody.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import * as React from 'react'; | ||
import { css } from '@patternfly/react-styles'; | ||
import styles from '@patternfly/patternfly/components/ModalBox/modal-box.css'; | ||
|
||
export interface ModalBoxBodyProps extends React.HTMLProps<HTMLDivElement> { | ||
/** content rendered inside the ModalBoxBody */ | ||
children?: React.ReactNode; | ||
/** additional classes added to the ModalBoxBody */ | ||
className?: string; | ||
} | ||
|
||
export const ModalBoxBody: React.FunctionComponent<ModalBoxBodyProps> = ({ | ||
children = null, | ||
className = '', | ||
...props | ||
}) => ( | ||
<div {...props} className={css(styles.modalBoxBody, className)}> | ||
{children} | ||
</div> | ||
); | ||
|
||
export default ModalBoxBody; |
10 changes: 0 additions & 10 deletions
10
packages/patternfly-4/react-core/src/components/Modal/ModalBoxCloseButton.d.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.