-
Notifications
You must be signed in to change notification settings - Fork 4k
Show reportID in report details panel #57942
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
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
5ed3510
add reportID infor in the report detail page
mkzie2 8e99f9c
Merge branch 'main' of https://github.com/mkzie2/App into mkzie2-issu…
mkzie2 329d3d3
fix lint
mkzie2 77670ce
make pressing report id title copiable
mkzie2 6336cd0
Merge branch 'main' of https://github.com/mkzie2/App into mkzie2-issu…
mkzie2 dcb7205
fix skew content in report details page
mkzie2 92edc97
Merge branch 'main' of https://github.com/mkzie2/App into mkzie2-issu…
mkzie2 5390816
disable long press to copy
mkzie2 bf3553c
disable text selection on mobile chrome
mkzie2 359a38b
Merge branch 'main' of https://github.com/mkzie2/App into mkzie2-issu…
mkzie2 dd3ce9d
add jsdoc
mkzie2 3cb0dcf
Merge branch 'main' of https://github.com/mkzie2/App into mkzie2-issu…
mkzie2 33d8249
dont show cursor pointer or hover background
mkzie2 1db7cba
Merge branch 'main' of https://github.com/mkzie2/App into mkzie2-issu…
mkzie2 18d9859
prettier
mkzie2 6e43fc9
apply new copy behavior
mkzie2 00ceaea
Merge branch 'main' of https://github.com/mkzie2/App into mkzie2-issu…
mkzie2 1388269
not show pointer cursor
mkzie2 c0cffd5
Merge branch 'main' of https://github.com/mkzie2/App into mkzie2-issu…
mkzie2 90757e7
modify function name
mkzie2 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| import React, {useRef} from 'react'; | ||
| import type {GestureResponderEvent, View} from 'react-native'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import {showContextMenu} from '@pages/home/report/ContextMenu/ReportActionContextMenu'; | ||
| import CONST from '@src/CONST'; | ||
| import PressableWithSecondaryInteraction from './PressableWithSecondaryInteraction'; | ||
| import Text from './Text'; | ||
| import type {TextProps} from './Text'; | ||
|
|
||
| type TextWithCopyProps = TextProps & { | ||
| /** The value to copy when the text component is pressed */ | ||
| copyValue: string; | ||
| }; | ||
|
|
||
| /** | ||
| * A text component that copies the text to the clipboard when pressed. | ||
| * This is different from the `copyValueToClipboard` component in that | ||
| * here the copy functionality is incorporated into the text itself. | ||
| * Long press this text to toggle the context menu containing the copy option. | ||
| */ | ||
| function TextWithCopy({children, copyValue, ...rest}: TextWithCopyProps) { | ||
| const popoverAnchor = useRef<View>(null); | ||
| const styles = useThemeStyles(); | ||
|
|
||
| const showCopyContextMenu = (event: GestureResponderEvent | MouseEvent) => { | ||
| if (!copyValue) { | ||
| return; | ||
| } | ||
| showContextMenu({ | ||
| type: CONST.CONTEXT_MENU_TYPES.TEXT, | ||
| event, | ||
| selection: copyValue, | ||
| contextMenuAnchor: popoverAnchor.current, | ||
| }); | ||
| }; | ||
|
|
||
| return ( | ||
| <PressableWithSecondaryInteraction | ||
| ref={popoverAnchor} | ||
| onSecondaryInteraction={showCopyContextMenu} | ||
| accessibilityLabel={copyValue} | ||
| accessible | ||
| style={styles.cursorDefault} | ||
| > | ||
| <Text | ||
| selectable={false} | ||
| numberOfLines={1} | ||
| // eslint-disable-next-line react/jsx-props-no-spreading | ||
| {...rest} | ||
| > | ||
| {children} | ||
| </Text> | ||
| </PressableWithSecondaryInteraction> | ||
| ); | ||
| } | ||
|
|
||
| export default TextWithCopy; |
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
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.
Is the translation confirmed? Do you need me to post a message in the Slack channel?
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.
That would be great as I haven't had access to Slack yet. Thank you.