fix: Upload should work with LocaleProvider (#5388)

This commit is contained in:
natergj 2017-03-20 02:20:15 -05:00 committed by Benjy Cui
parent 35ab3fbf75
commit c2cb111f7b

View File

@ -7,6 +7,12 @@ import UploadList from './UploadList';
import { UploadProps, UploadLocale } from './interface';
import { T, fileToObject, genPercentAdd, getFileItem, removeFileItem } from './utils';
export interface UploadContext {
antLocale?: {
Upload?: any,
};
}
const defaultLocale: UploadLocale = {
uploading: '文件上传中',
removeFile: '删除文件',
@ -34,6 +40,12 @@ export default class Upload extends React.Component<UploadProps, any> {
supportServerRender: true,
};
static contextTypes = {
antLocale: React.PropTypes.object,
};
context: UploadContext;
recentUploadStatus: boolean | PromiseLike<any>;
progressTimer: any;
refs: {