-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1577 from dedis/work-fe1-dmassonn-fix-long-chirp-…
…overflowing Fix long chirps being cut off scren
- Loading branch information
Showing
4 changed files
with
23 additions
and
0 deletions.
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
2 changes: 2 additions & 0 deletions
2
fe1-web/src/core/platform/cssStyle/WordBreakPolyfill.native.ts
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,2 @@ | ||
// Replaces the polyfill | ||
export default () => {}; |
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,15 @@ | ||
import { Platform } from 'react-native'; | ||
|
||
/** | ||
* This polyfill is required to make sure that long words are broken for chirps | ||
* This is done by adding a css style to the head of the document | ||
*/ | ||
export default () => { | ||
if (Platform.OS !== 'web' || typeof 'navigator' === undefined) { | ||
return; | ||
} | ||
|
||
const style = document.createElement('style'); | ||
style.textContent = '* {word-break: break-word;}'; | ||
document.head.append(style); | ||
}; |
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