-
Notifications
You must be signed in to change notification settings - Fork 3k
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 #30081 from ayazalavi/ayaz/GH-29021_am_pm_selectio…
…n_bug [CP Staging] added component
- Loading branch information
Showing
3 changed files
with
42 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import * as EmojiUtils from '../../libs/EmojiUtils'; | ||
import * as Browser from '../../libs/Browser'; | ||
import Text from '../Text'; | ||
|
||
const propTypes = { | ||
/** If this is the Concierge chat, we'll open the modal for requesting a setup call instead of showing popover menu */ | ||
text: PropTypes.string, | ||
|
||
/** URL to the assigned guide's appointment booking calendar */ | ||
displayAsGroup: PropTypes.bool, | ||
}; | ||
|
||
const defaultProps = { | ||
text: '', | ||
displayAsGroup: false, | ||
}; | ||
|
||
function ZeroWidthView({text, displayAsGroup}) { | ||
const firstLetterIsEmoji = EmojiUtils.isFirstLetterEmoji(text); | ||
if (firstLetterIsEmoji && !displayAsGroup && !Browser.isMobile()) { | ||
return <Text>​</Text>; | ||
} | ||
return null; | ||
} | ||
|
||
ZeroWidthView.propTypes = propTypes; | ||
ZeroWidthView.defaultProps = defaultProps; | ||
ZeroWidthView.displayName = 'ZeroWidthView'; | ||
|
||
export default ZeroWidthView; |
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,5 @@ | ||
function ZeroWidthView() { | ||
return null; | ||
} | ||
|
||
export default ZeroWidthView; |
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