• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

react-ui-org / react-ui / 13347780833

15 Feb 2025 06:54PM UTC coverage: 91.854%. Remained the same
13347780833

Pull #589

github

web-flow
Merge 76a407e47 into 12a08088f
Pull Request #589: Update Github Workflows to use Ubuntu 24.04

815 of 892 branches covered (91.37%)

Branch coverage included in aggregate %.

741 of 802 relevant lines covered (92.39%)

71.72 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.0
/src/components/Modal/ModalBody.jsx
1
import PropTypes from 'prop-types';
2
import React from 'react';
3
import { withGlobalProps } from '../../providers/globalProps';
4
import { classNames } from '../../utils/classNames';
5
import { transferProps } from '../../utils/transferProps';
6
import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
7
import { getScrollingClassName } from './_helpers/getScrollingClassName';
8
import styles from './ModalBody.module.scss';
9

10
export const ModalBody = ({
4✔
11
  children,
12
  scrolling,
13
  ...restProps
14
}) => {
15
  if (isChildrenEmpty(children)) {
22!
16
    return null;
×
17
  }
18

19
  return (
22✔
20
    <div
21
      {...transferProps(restProps)}
22
      className={classNames(
23
        styles.root,
24
        getScrollingClassName(scrolling, styles),
25
      )}
26
    >
27
      {children}
28
    </div>
29
  );
30
};
31

32
ModalBody.defaultProps = {
4✔
33
  children: null,
34
  scrolling: 'auto',
35
};
36

37
ModalBody.propTypes = {
4✔
38
  /**
39
   * Nested elements. Supported types are:
40
   *
41
   * * `ModalContent`
42
   * * `ScrollView` (`scrolling: 'custom'` must be set)
43
   *
44
   * You can also provide a custom component responsible for scrolling and displaying content correctly.
45
   * At most one nested element is allowed. If none are provided nothing is rendered.
46
   */
47
  children: PropTypes.node,
48
  /**
49
   * Scrolling mode:
50
   *
51
   * - `auto`: scrolling is enabled on ModalBody.
52
   * - `custom`: use if providing a custom scrolling component, e.g. an instance of `ScrollView`.
53
   * - `none`: scrolling is disabled on ModalBody and the entire Modal is scrollable instead.
54
   */
55
  scrolling: PropTypes.oneOf(['auto', 'custom', 'none']),
56
};
57

58
export const ModalBodyWithGlobalProps = withGlobalProps(ModalBody, 'ModalBody');
4✔
59

60
export default ModalBodyWithGlobalProps;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc