Trying to override File Uploader's button text, but ButtonComponent.props
has any
type, so can't figure out what I am able to pass there. My idea inspired by Button docs was to set children
property, but button text remains unchanged. Could anyone give a hint?
import { FileUploaderProps, FileUploader } from 'baseui/file-uploader';
import React, { FC } from 'react';
const StyledFileUploader: FC<FileUploaderProps> = (props) => {
return (
<FileUploader
{...props}
overrides={{
ButtonComponent: {
props: {
children: 'text',
overrides: {
BaseButton: {
children: 'text',
props: {
children: 'text',
},
style: () => ({
backgroundColor: '#A4A4A4',
color: '#fff',
borderRadius: '2px',
paddingTop: '3px',
paddingRight: '22px',
paddingBottom: '3px',
paddingLeft: '22px',
fontSize: '16px',
lineHeight: '20px',
':hover': {
backgroundColor: '#A4A4A4',
color: '#fff',
},
}),
},
},
},
},
FileDragAndDrop: {
style: () => {
return {
backgroundColor: 'transparent',
borderLeftColor: 'transparent',
borderRightColor: 'transparent',
borderTopColor: 'transparent',
borderBottomColor: 'transparent',
};
},
},
ContentMessage: {
style: () => {
return {
display: 'none',
};
},
},
}}
/>
);
};
export default StyledFileUploader;