Cloud Defense Logo

Products

Solutions

Company

Book A Live Demo

Top 2 Examples of "bpk-scrim-utils in functional component" in JavaScript

Dive into secure and efficient coding practices with our curated list of the top 10 examples showcasing 'bpk-scrim-utils' in functional components in JavaScript. Our advanced machine learning engine meticulously scans each line of code, cross-referencing millions of open source libraries to ensure your implementation is not just functional, but also robust and secure. Elevate your React applications to new heights by mastering the art of handling side effects, API calls, and asynchronous operations with confidence and precision.

import PropTypes from 'prop-types';
import React, { type Element } from 'react';
import { withScrim } from 'bpk-scrim-utils';
import { Portal, cssModules } from 'bpk-react-utils';

import STYLES from './BpkModal.scss';
import BpkModalDialog, {
  propTypes as modalDialogPropTypes,
  defaultProps as modalDialogDefaultProps,
  type Props as ModalDialogProps,
} from './BpkModalDialog';
import { modalOnClosePropType } from './customPropTypes';

const getClassName = cssModules(STYLES);
const ScrimBpkModalDialog = withScrim(BpkModalDialog);

// Please remove this type when `withScrim` is flow-typed
type ScrimProps = {
  isIphone: boolean,
  dialogRef: () => ?HTMLElement,
};

export type Props = {
  // The `withScrim` HOC satisfies some of the ModalDialogs required
  // props but it's not flow typed yet so this
  // diff will suffice for now.
  ...$Exact<$Diff>,
  isOpen: boolean,
  isIphone: boolean,
  closeOnScrimClick: boolean,
  closeOnEscPressed: boolean,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { Portal, cssModules } from 'bpk-react-utils';
import { withScrim } from 'bpk-scrim-utils';

import BpkDrawerContent from './BpkDrawerContent';
import STYLES from './BpkDrawer.scss';

const getClassName = cssModules(STYLES);

const BpkScrimDrawerContent = withScrim(BpkDrawerContent);

class BpkDrawer extends Component {
  constructor() {
    super();

    this.state = {
      isDrawerShown: true,
    };
  }

  componentWillReceiveProps(nextProps) {
    if (!this.props.isOpen && nextProps.isOpen) {
      this.setState({ isDrawerShown: true });
    }
  }

Is your System Free of Underlying Vulnerabilities?
Find Out Now