Repository navigation
Add attachment button link that links to expensify.com report #399
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
16 commits
Select commit
Hold shift + click to select a range
4dc16df
Get current report opening in new tab on click
Jag96 8ef6ac4
add paperclip icon
Jag96 3f3d813
fix props and css
Jag96 abf144e
move attachment icon left of input box
Jag96 0decfd7
keep border when textarea grows
Jag96 d08803f
make link work on dev
Jag96 e755e1d
remove unnecessary css class
Jag96 4c6c041
Styling up the attach button
shawnborton c9908a9
Minor padding tweak
shawnborton 8ef042a
fix style warning
Jag96 c2d5fe0
use lib instead of component
Jag96 d372fe3
Merge branch 'master' into joe-new-tab-reports
Jag96 0abfd7c
re-add reportID prop
Jag96 8a5a768
update comment
Jag96 a008a17
use new lib instead of anchor component
Jag96 ca5041c
prevent warning on ios/android
Jag96 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,13 @@ | ||
| /** | ||
| * On web, the Linking.openURL implementation does not open a URL in a new tab by default. This lib allows for that | ||
| * functionality. | ||
| */ | ||
|
|
||
| /** | ||
| * @param {String} href | ||
| */ | ||
| const openURLInNewTab = (href) => { | ||
| window.open(href, '_blank'); | ||
| }; | ||
|
|
||
| export default openURLInNewTab; | ||
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,12 @@ | ||
| // Mobile implementation to match the web lib, this will open the URL in the browser | ||
|
|
||
| import {Linking} from 'react-native'; | ||
|
|
||
| /** | ||
| * @param {String} href | ||
| */ | ||
| const openURLInNewTab = (href) => { | ||
| Linking.openURL(href); | ||
| }; | ||
|
|
||
| export default openURLInNewTab; |
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
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.
Should we refactor the
<Anchor>component to useopenURLInNewTab? It has the same idea where we have to usewindow.openon web andLinkingfor native.cc @marcaaron or @tgolen for thoughts
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.
Yeah! Do they differ in any other way besides this method? I think that's a good case for eliminating two separate implementations by creating a shared behavior instead of components that specialize in a behavior.
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.
Tested it out and it works! I'll remove the Anchor component and add some tests to this PR confirm the behavior