Skip to content

Commit

Permalink
fix(Upload): fix global icon replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
uyarn committed Jul 24, 2024
1 parent 6ead456 commit f0b5fef
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/upload/upload.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { ForwardedRef, forwardRef } from 'react';
import { UploadIcon } from 'tdesign-icons-react';
import { UploadIcon as TdUploadIcon } from 'tdesign-icons-react';
import classNames from 'classnames';
import NormalFile from './themes/NormalFile';
import DraggerFile from './themes/DraggerFile';
Expand All @@ -13,7 +13,9 @@ import { UploadDragEvents } from './hooks/useDrag';
import CustomFile from './themes/CustomFile';
import { UploadFile } from './type';
import parseTNode from '../_util/parseTNode';

import useDefaultProps from '../hooks/useDefaultProps';
import useGlobalIcon from '../hooks/useGlobalIcon';

// const Upload = forwardRef((props: UploadProps, ref) => {
function TdUpload<T extends UploadFile = UploadFile>(originalProps: UploadProps<T>, ref: ForwardedRef<UploadRef>) {
Expand Down Expand Up @@ -52,6 +54,10 @@ function TdUpload<T extends UploadFile = UploadFile>(originalProps: UploadProps<
cancelUpload,
}));

const { UploadIcon } = useGlobalIcon({
UploadIcon: TdUploadIcon,
});

const renderTrigger = () => {
const getDefaultTrigger = () => {
if (theme === 'file-input') {
Expand Down

0 comments on commit f0b5fef

Please sign in to comment.