Skip to content

Commit

Permalink
fix loading component
Browse files Browse the repository at this point in the history
  • Loading branch information
ishpaul777 committed May 13, 2024
1 parent 3763d32 commit da41661
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/components/PDFView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,6 @@ function PDFView({onToggleKeyboard, fileName, onPress, isFocused, sourceURL, max
}
}, [isKeyboardOpen, prevWindowHeight, toggleKeyboardOnSmallScreens, windowHeight]);

const renderLoadingIndicator = () => {
if (isUsedAsChatAttachment) {
return (
<View style={[styles.chatItemPDFAttachmentLoading, StyleUtils.getWidthAndHeightStyle(LOADING_THUMBNAIL_WIDTH, LOADING_THUMBNAIL_HEIGHT)]}>
<ActivityIndicator
color={theme.spinner}
size="large"
/>
</View>
);
}

return <FullScreenLoadingIndicator />;
};

const renderPDFView = () => {
const outerContainerStyle = [styles.w100, styles.h100, styles.justifyContentCenter, styles.alignItemsCenter];

Expand All @@ -116,7 +101,7 @@ function PDFView({onToggleKeyboard, fileName, onPress, isFocused, sourceURL, max
maxCanvasWidth={maxCanvasWidth}
maxCanvasHeight={maxCanvasHeight}
maxCanvasArea={maxCanvasArea}
LoadingComponent={renderLoadingIndicator()}
LoadingComponent={<FullScreenLoadingIndicator style={isUsedAsChatAttachment && [styles.chatItemPDFAttachmentLoading, StyleUtils.getWidthAndHeightStyle(LOADING_THUMBNAIL_WIDTH, LOADING_THUMBNAIL_HEIGHT), styles.pRelative]} />}
shouldShowErrorComponent={false}
onLoadError={onLoadError}
renderPasswordForm={({isPasswordInvalid, onSubmit, onPasswordChange}) => (
Expand Down

0 comments on commit da41661

Please sign in to comment.