Skip to content

Commit

Permalink
fix: Upload should work with LocaleProvider (#5388)
Browse files Browse the repository at this point in the history
  • Loading branch information
natergj authored and benjycui committed Mar 20, 2017
1 parent 35ab3fb commit c2cb111
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions components/upload/Upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: '删除文件',
Expand Down Expand Up @@ -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: {
Expand Down

0 comments on commit c2cb111

Please sign in to comment.