-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Handle emoji tooltip #35838
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
Handle emoji tooltip #35838
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
b930ed4
implement tooltip for emoji
dukenv0307 7385bf2
Merge branch 'main' into fix/34307
dukenv0307 925d6c3
implement tooltip for emoji
dukenv0307 ff81b72
write new file in typescript
dukenv0307 b6ecd0f
merge main
dukenv0307 21d6337
Merge branch 'main' into fix/34307
dukenv0307 d5f99a0
Merge branch 'main' into fix/34307
dukenv0307 ab0f57b
fix edge case
dukenv0307 54a21ae
write new page on ts
dukenv0307 046522e
revert local change
dukenv0307 47e78b6
disable tooltip for native
dukenv0307 a0f72ef
Merge branch 'main' into fix/34307
dukenv0307 4a9f29e
bump version of expensify-common
dukenv0307 2b5ec33
Merge branch 'main' into fix/34307
dukenv0307 1de60ab
Update src/styles/index.ts
dukenv0307 5a6a291
Merge branch 'main' into fix/34307
dukenv0307 2755f34
merge main
dukenv0307 a9bd9b4
fix ts error
dukenv0307 a0e43e0
merge main
dukenv0307 05c9b28
Merge branch 'main' into fix/34307
dukenv0307 0501a41
merge main
dukenv0307 439e629
fix the case emoji that is made up by some different emojis
dukenv0307 cf36e9b
Merge branch 'main' into fix/34307
dukenv0307 d622078
update version expesify-common
dukenv0307 7a65924
Merge branch 'main' into fix/34307
dukenv0307 db43ff1
Merge branch 'main' into fix/34307
dukenv0307 7eedaf3
add new attribute for emoji tag if contain only emoji
dukenv0307 5382c13
Merge branch 'main' into fix/34307
dukenv0307 62d558d
add check shouldRenderAsText for seprate platform
dukenv0307 1a34f6b
merge main
dukenv0307 a37188a
fix case delete emoji
dukenv0307 4cad935
merge main
dukenv0307 2a292da
Merge branch 'main' into fix/34307
dukenv0307 5f599ae
fix test
dukenv0307 bcb3510
fix lint
dukenv0307 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
12 changes: 12 additions & 0 deletions
12
src/pages/home/report/comment/shouldRenderAsText.native.ts
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 @@ | ||
import Str from 'expensify-common/lib/str'; | ||
|
||
/** | ||
* Whether to render the report action as text | ||
*/ | ||
export default function shouldRenderAsText(html: string, text: string): boolean { | ||
// On native, we render emoji as text to prevent the large emoji is cut off when the action is edited. | ||
// More info: https://github.com/Expensify/App/pull/35838#issuecomment-1964839350 | ||
const htmlWithoutLineBreak = Str.replaceAll(html, '<br />', '\n'); | ||
const htmlWithoutEmojiOpenTag = Str.replaceAll(htmlWithoutLineBreak, '<emoji>', ''); | ||
return Str.replaceAll(htmlWithoutEmojiOpenTag, '</emoji>', '') === text; | ||
} |
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,8 @@ | ||
import Str from 'expensify-common/lib/str'; | ||
|
||
/** | ||
* Whether to render the report action as text | ||
*/ | ||
export default function shouldRenderAsText(html: string, text: string): boolean { | ||
return Str.replaceAll(html, '<br />', '\n') === text; | ||
} |
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.
Create a new directory shouldRenderAsText and add index.native.ts, index.ts and types.ts
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 updated.