Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
Signed-off-by: Shan He <heshan0131@gmail.com>
  • Loading branch information
heshan0131 committed Oct 9, 2024
1 parent 378fc88 commit 066785c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 26 deletions.
40 changes: 15 additions & 25 deletions src/components/src/modals/load-data-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,25 @@ export function LoadDataModalFactory(
FileUpload: ReturnType<typeof FileUploadFactory>,
LoadStorageMap: ReturnType<typeof LoadStorageMapFactory>
) {
/** @type {React.FunctionComponent<LoadDataModalProps>} */
const defaultLoadingMethods = [
{
id: LOADING_METHODS.upload,
label: 'modal.loadData.upload',
elementType: FileUpload
},
{
id: LOADING_METHODS.storage,
label: 'modal.loadData.storage',
elementType: LoadStorageMap
}
];

const LoadDataModal: React.FC<LoadDataModalProps> & {
defaultLoadingMethods: LoadDataModalProps['loadingMethods'];
} = ({
onFileUpload = noop,
fileLoading = false,
loadingMethods = [
{
id: LOADING_METHODS.upload,
label: 'modal.loadData.upload',
elementType: FileUpload
},
{
id: LOADING_METHODS.storage,
label: 'modal.loadData.storage',
elementType: LoadStorageMap
}
],
loadingMethods = defaultLoadingMethods,
isCloudMapLoading,
...restProps
}) => {
Expand Down Expand Up @@ -112,18 +113,7 @@ export function LoadDataModalFactory(
);
};

LoadDataModal.defaultLoadingMethods = [
{
id: LOADING_METHODS.upload,
label: 'modal.loadData.upload',
elementType: FileUpload
},
{
id: LOADING_METHODS.storage,
label: 'modal.loadData.storage',
elementType: LoadStorageMap
}
];
LoadDataModal.defaultLoadingMethods = defaultLoadingMethods;

return LoadDataModal;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ const CustomPicker: React.FC<CustomPickerProps> = props => {
);
};

export default withTheme(CustomPicker as React.FC<CustomPickerProps>);
export default withTheme(CustomPicker);

0 comments on commit 066785c

Please sign in to comment.