-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Fix blank area after loading pdf #38010
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
yuwenmemon
merged 60 commits into
Expensify:main
from
ishpaul777:fix-blankArea-after-loading-pdf
May 15, 2024
Merged
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
ffb21f1
add POC for fallingback to default attachment view when pdf fails to …
ishpaul777 bde48fa
adds chnages for attachement view
ishpaul777 9323594
Merge branch 'fix/blankArea-for-corruptedPDF' into fix-blankArea-afte…
ishpaul777 757661b
formatting
ishpaul777 c4fce87
Merge branch 'fix-blankArea-after-loading-pdf' of https://github.com/…
ishpaul777 26c1f13
fixes conflicts
ishpaul777 36b5814
fix conflict after merge
ishpaul777 f7b6cd5
Merge branch 'Expensify:main' into fix-blankArea-after-loading-pdf
ishpaul777 75a733c
clean up and lint fix
ishpaul777 1a84b64
Merge branch 'Expensify:main' into fix-blankArea-after-loading-pdf
ishpaul777 e2b9966
add POC for fallingback to default attachment view when pdf fails to …
ishpaul777 02f26eb
fixes missing prop
ishpaul777 2d37945
Merge branch 'fix-blankArea-after-loading-pdf' of https://github.com/…
ishpaul777 b4ac9a1
remove unused import
ishpaul777 0372601
change variable name
ishpaul777 a20811a
fixes lint
ishpaul777 3ace4d3
use correct conditional and use js docs for props
ishpaul777 830a392
prettier diffs
ishpaul777 3813026
Update src/components/Attachments/AttachmentCarousel/CarouselItem.js
ishpaul777 a8cfafe
remove unused styles
ishpaul777 5199de9
Merge branch 'Expensify:main' into fix-blankArea-after-loading-pdf
ishpaul777 ccbcfe0
Merge branch 'Expensify:main' into fix-blankArea-after-loading-pdf
ishpaul777 a45f6f0
remove error label styles
ishpaul777 1f489cf
Merge branch 'fix-blankArea-after-loading-pdf' of https://github.com/…
ishpaul777 cb7ba78
Merge branch 'main' into fix-blankArea-after-loading-pdf
ishpaul777 81efdb2
Merge branch 'main' into fix-blankArea-after-loading-pdf
ishpaul777 32f3503
fix conflicts
ishpaul777 1c814c5
fix lint
ishpaul777 302fdba
fallback to defaultview component
ishpaul777 3b51760
fix prop pass
ishpaul777 7d5d22a
prettier diffs
ishpaul777 088813d
Merge branch 'Expensify:main' into fix-blankArea-after-loading-pdf
ishpaul777 0af56c6
remove renderfallbackview prop
ishpaul777 b18b06a
fix the comment for the prop
ishpaul777 6436ddb
fixes loading for pdf on web
ishpaul777 359c54d
fixes proptype warning
ishpaul777 691e2a8
prettier diffs
ishpaul777 2b1bff7
Merge branch 'Expensify:main' into fix-blankArea-after-loading-pdf
ishpaul777 9bd4c96
adds onError prop in react-fast-pdf
ishpaul777 7003564
Merge branch 'main' into fix-blankArea-after-loading-pdf
ishpaul777 e714b2f
resolve conflicts
ishpaul777 15eea96
code formatting
ishpaul777 7a9565a
remove unnecessary change
ishpaul777 6912979
fix type checks
ishpaul777 917095c
lint code
ishpaul777 c968147
prettier diffs
ishpaul777 cadf1f1
resolve lint failure
ishpaul777 54eb295
prettier diffs
ishpaul777 3044ee9
Merge branch 'Expensify:main' into fix-blankArea-after-loading-pdf
ishpaul777 9c1527b
remove unnecessary styles
ishpaul777 3c871f1
Merge branch 'Expensify:main' into fix-blankArea-after-loading-pdf
ishpaul777 0338f8d
merge main
ishpaul777 838e465
prettier diffs
ishpaul777 17ed872
Merge branch 'Expensify:main' into fix-blankArea-after-loading-pdf
ishpaul777 3763d32
fixes preview not centered in carousel
ishpaul777 da41661
fix loading component
ishpaul777 c134239
prettier
ishpaul777 9c1b2c4
Merge branch 'Expensify:main' into fix-blankArea-after-loading-pdf
ishpaul777 e1d69f6
Add-empty-newlines
ishpaul777 569b7c1
adds requested changes
ishpaul777 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.