-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
132 additions
and
40 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
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
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
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,28 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import BaseQuickEmojiReactions, {baseQuickEmojiReactionsDefaultProps, baseQuickEmojiReactionsPropTypes} from './BaseQuickEmojiReactions'; | ||
|
||
const propTypes = { | ||
...baseQuickEmojiReactionsPropTypes, | ||
closeContextMenu: PropTypes.func.isRequired, | ||
}; | ||
|
||
const QuickEmojiReactions = (props) => { | ||
const onPressOpenPicker = (openPicker) => { | ||
openPicker(); | ||
}; | ||
|
||
return ( | ||
<BaseQuickEmojiReactions | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...props} | ||
onPressOpenPicker={onPressOpenPicker} | ||
onWillShowPicker={props.closeContextMenu} | ||
/> | ||
); | ||
}; | ||
|
||
QuickEmojiReactions.displayName = 'QuickEmojiReactions'; | ||
QuickEmojiReactions.propTypes = propTypes; | ||
QuickEmojiReactions.defaultProps = baseQuickEmojiReactionsDefaultProps; | ||
export default QuickEmojiReactions; |
29 changes: 29 additions & 0 deletions
29
src/components/Reactions/QuickEmojiReactions/index.native.js
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,29 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import BaseQuickEmojiReactions, {baseQuickEmojiReactionsDefaultProps, baseQuickEmojiReactionsPropTypes} from './BaseQuickEmojiReactions'; | ||
|
||
const propTypes = { | ||
...baseQuickEmojiReactionsPropTypes, | ||
closeContextMenu: PropTypes.func.isRequired, | ||
}; | ||
|
||
const QuickEmojiReactions = (props) => { | ||
const onPressOpenPicker = (openPicker) => { | ||
// We first need to close the menu as it's a popover. | ||
// The picker is a popover as well and on mobile there can only | ||
// be one active popover at a time. | ||
props.closeContextMenu(() => { | ||
requestAnimationFrame(openPicker); | ||
}); | ||
}; | ||
|
||
return ( | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
<BaseQuickEmojiReactions {...props} onPressOpenPicker={onPressOpenPicker} /> | ||
); | ||
}; | ||
|
||
QuickEmojiReactions.displayName = 'QuickEmojiReactions'; | ||
QuickEmojiReactions.propTypes = propTypes; | ||
QuickEmojiReactions.defaultProps = baseQuickEmojiReactionsDefaultProps; | ||
export default QuickEmojiReactions; |
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