forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Expensify#38010 from ishpaul777/fix-blankArea-afte…
…r-loading-pdf Fix blank area after loading pdf
- Loading branch information
Showing
12 changed files
with
158 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
src/components/Attachments/AttachmentView/DefaultAttachmentView/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import React from 'react'; | ||
import type {StyleProp, ViewStyle} from 'react-native'; | ||
import {ActivityIndicator, View} from 'react-native'; | ||
import Icon from '@components/Icon'; | ||
import * as Expensicons from '@components/Icon/Expensicons'; | ||
import Text from '@components/Text'; | ||
import Tooltip from '@components/Tooltip'; | ||
import useLocalize from '@hooks/useLocalize'; | ||
import useTheme from '@hooks/useTheme'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
|
||
type DefaultAttachmentViewProps = { | ||
/** The name of the file */ | ||
fileName?: string; | ||
|
||
/** Should show the download icon */ | ||
shouldShowDownloadIcon?: boolean; | ||
|
||
/** Should show the loading spinner icon */ | ||
shouldShowLoadingSpinnerIcon?: boolean; | ||
|
||
/** Additional styles for the container */ | ||
containerStyles?: StyleProp<ViewStyle>; | ||
}; | ||
|
||
function DefaultAttachmentView({fileName = '', shouldShowLoadingSpinnerIcon = false, shouldShowDownloadIcon, containerStyles}: DefaultAttachmentViewProps) { | ||
const theme = useTheme(); | ||
const styles = useThemeStyles(); | ||
const {translate} = useLocalize(); | ||
|
||
return ( | ||
<View style={[styles.defaultAttachmentView, containerStyles]}> | ||
<View style={styles.mr2}> | ||
<Icon | ||
fill={theme.icon} | ||
src={Expensicons.Paperclip} | ||
/> | ||
</View> | ||
|
||
<Text style={[styles.textStrong, styles.flexShrink1, styles.breakAll, styles.flexWrap, styles.mw100]}>{fileName}</Text> | ||
{!shouldShowLoadingSpinnerIcon && shouldShowDownloadIcon && ( | ||
<Tooltip text={translate('common.download')}> | ||
<View style={styles.ml2}> | ||
<Icon | ||
fill={theme.icon} | ||
src={Expensicons.Download} | ||
/> | ||
</View> | ||
</Tooltip> | ||
)} | ||
{shouldShowLoadingSpinnerIcon && ( | ||
<View style={styles.ml2}> | ||
<Tooltip text={translate('common.downloading')}> | ||
<ActivityIndicator | ||
size="small" | ||
color={theme.textSupporting} | ||
/> | ||
</Tooltip> | ||
</View> | ||
)} | ||
</View> | ||
); | ||
} | ||
|
||
DefaultAttachmentView.displayName = 'DefaultAttachmentView'; | ||
|
||
export default DefaultAttachmentView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.