-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Chat - File does not appear with strikethrough style when uploaded offline and deleted #47971
Merged
neil-marcellini
merged 22 commits into
Expensify:main
from
Krishna2323:krishna2323/issue/46616
Oct 23, 2024
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
24221c7
fix: Chat - File does not appear with strikethrough style when upload…
Krishna2323 8bcdcbc
Merge branch 'Expensify:main' into krishna2323/issue/46616
Krishna2323 05b2f2d
updated design.
Krishna2323 ed9a174
Merge branch 'Expensify:main' into krishna2323/issue/46616
Krishna2323 365fd73
add deleted indicator for video renderer.
Krishna2323 98aa154
add styles object for deleted indicator.
Krishna2323 0100314
add AttachmentDeletedIndicator.tsx
Krishna2323 dc8d1ce
Merge branch 'main' into krishna2323/issue/46616
Krishna2323 1eb1b71
Merge branch 'Expensify:main' into krishna2323/issue/46616
Krishna2323 609dd79
Merge branch 'Expensify:main' into krishna2323/issue/46616
Krishna2323 15353c7
fix icon colot.
Krishna2323 9d305c0
Merge branch 'main' into krishna2323/issue/46616
Krishna2323 0cb93cd
fix lint issues.
Krishna2323 434b6a6
Merge branch 'Expensify:main' into krishna2323/issue/46616
Krishna2323 6ca5df9
add suggested changes.
Krishna2323 2f60806
Merge branch 'Expensify:main' into krishna2323/issue/46616
Krishna2323 d4a068f
fix: lint issues.
Krishna2323 ff3654b
Merge branch 'Expensify:main' into krishna2323/issue/46616
Krishna2323 2c26757
Merge branch 'main' into krishna2323/issue/46616
Krishna2323 98c927b
Merge branch 'main' into krishna2323/issue/46616
Krishna2323 a7821d1
fix: lint issues.
Krishna2323 ec696aa
Merge branch 'main' into krishna2323/issue/46616
Krishna2323 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
import type {StyleProp, ViewStyle} from 'react-native'; | ||
import useNetwork from '@hooks/useNetwork'; | ||
import useTheme from '@hooks/useTheme'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
import variables from '@styles/variables'; | ||
import Icon from './Icon'; | ||
import * as Expensicons from './Icon/Expensicons'; | ||
|
||
type AttachmentDeletedIndicatorProps = { | ||
/** Additional styles for container */ | ||
containerStyles?: StyleProp<ViewStyle>; | ||
}; | ||
|
||
function AttachmentDeletedIndicator({containerStyles}: AttachmentDeletedIndicatorProps) { | ||
const theme = useTheme(); | ||
const styles = useThemeStyles(); | ||
const {isOffline} = useNetwork(); | ||
|
||
if (!isOffline) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<> | ||
<View | ||
style={[ | ||
styles.pAbsolute, | ||
styles.alignItemsCenter, | ||
styles.justifyContentCenter, | ||
styles.highlightBG, | ||
styles.deletedIndicatorOverlay, | ||
styles.deletedAttachmentIndicator, | ||
containerStyles, | ||
]} | ||
/> | ||
<View style={[styles.pAbsolute, styles.deletedAttachmentIndicator, styles.alignItemsCenter, styles.justifyContentCenter, containerStyles]}> | ||
<Icon | ||
fill={theme.icon} | ||
src={Expensicons.Trashcan} | ||
width={variables.iconSizeSuperLarge} | ||
height={variables.iconSizeSuperLarge} | ||
/> | ||
</View> | ||
</> | ||
); | ||
} | ||
|
||
AttachmentDeletedIndicator.displayName = 'AttachmentDeletedIndicator'; | ||
|
||
export default AttachmentDeletedIndicator; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,9 +38,12 @@ type VideoPlayerPreviewProps = { | |
|
||
/** Callback executed when modal is pressed. */ | ||
onShowModalPress: (event?: GestureResponderEvent | KeyboardEvent) => void | Promise<void>; | ||
|
||
/** Whether the video is deleted */ | ||
isDeleted?: boolean; | ||
}; | ||
|
||
function VideoPlayerPreview({videoUrl, thumbnailUrl, reportID, fileName, videoDimensions, videoDuration, onShowModalPress}: VideoPlayerPreviewProps) { | ||
function VideoPlayerPreview({videoUrl, thumbnailUrl, reportID, fileName, videoDimensions, videoDuration, onShowModalPress, isDeleted}: VideoPlayerPreviewProps) { | ||
const styles = useThemeStyles(); | ||
const {translate} = useLocalize(); | ||
const {currentlyPlayingURL, currentlyPlayingURLReportID, updateCurrentlyPlayingURL} = usePlaybackContext(); | ||
|
@@ -71,11 +74,12 @@ function VideoPlayerPreview({videoUrl, thumbnailUrl, reportID, fileName, videoDi | |
|
||
return ( | ||
<View style={[styles.webViewStyles.tagStyles.video, thumbnailDimensionsStyles]}> | ||
{shouldUseNarrowLayout || isThumbnail ? ( | ||
{shouldUseNarrowLayout || isThumbnail || isDeleted ? ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep, when attachment is deleted, we should be showing |
||
<VideoPlayerThumbnail | ||
thumbnailUrl={thumbnailUrl} | ||
onPress={handleOnPress} | ||
accessibilityLabel={fileName} | ||
isDeleted={isDeleted} | ||
/> | ||
) : ( | ||
<View style={styles.flex1}> | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this to styles?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's any benefit to that, but if you think otherwise, I can update it.