All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.src.components.MultipleFileUpload.MultipleFileUploadButton.tsx Maven / Gradle / Ivy

Go to download

This library provides a set of common React components for use with the PatternFly reference implementation.

The newest version!
import * as React from 'react';
import styles from '@patternfly/react-styles/css/components/MultipleFileUpload/multiple-file-upload';
import { css } from '@patternfly/react-styles';
import { MultipleFileUploadContext } from './MultipleFileUpload';
import { Button } from '../Button';

export interface MultipleFileUploadButtonProps extends React.HTMLProps {
  /** Class to add to outer div */
  className?: string;
  /** Aria-label for the button */
  'aria-label'?: string;
  /** Visible text label for the button */
  browseButtonText?: string;
}

export const MultipleFileUploadButton: React.FunctionComponent = ({
  className,
  'aria-label': ariaLabel,
  browseButtonText = 'Upload',
  ...props
}: MultipleFileUploadButtonProps) => {
  if (!ariaLabel && !browseButtonText) {
    // eslint-disable-next-line no-console
    console.warn(
      "For accessibility reasons an aria-label should be specified on MultipleFileUploadButton if a browseButtonText isn't"
    );
  }
  const { open } = React.useContext(MultipleFileUploadContext);

  return (
    
); }; MultipleFileUploadButton.displayName = 'MultipleFileUploadButton';




© 2015 - 2024 Weber Informatics LLC | Privacy Policy