package.src.components.MultipleFileUpload.MultipleFileUploadButton.tsx Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of react-core Show documentation
Show all versions of react-core Show documentation
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';