-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(toolbox/native): custom overflow menu buttons (#14594)
* feat(toolbox/native): custom buttons for the OverflowMenu
- Loading branch information
1 parent
b54cec8
commit 36671d7
Showing
10 changed files
with
172 additions
and
3 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
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
42 changes: 42 additions & 0 deletions
42
react/features/toolbox/components/native/CustomOptionButton.tsx
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,42 @@ | ||
import React from 'react'; | ||
import { Image } from 'react-native'; | ||
import { connect } from 'react-redux'; | ||
|
||
import { translate } from '../../../base/i18n/functions'; | ||
import AbstractButton, { IProps as AbstractButtonProps } | ||
from '../../../base/toolbox/components/AbstractButton'; | ||
|
||
import styles from './styles'; | ||
|
||
|
||
interface IProps extends AbstractButtonProps { | ||
icon: any; | ||
id?: string; | ||
text: string; | ||
} | ||
|
||
/** | ||
* Component that renders a custom button. | ||
* | ||
* @returns {Component} | ||
*/ | ||
class CustomOptionButton extends AbstractButton<IProps> { | ||
iconSrc = this.props.icon; | ||
id = this.props.id; | ||
text = this.props.text; | ||
|
||
/** | ||
* Custom icon component. | ||
* | ||
* @returns {React.Component} | ||
*/ | ||
icon = () => ( | ||
<Image | ||
source = {{ uri: this.iconSrc }} | ||
style = { styles.iconImageStyles } /> | ||
); | ||
|
||
label = this.text; | ||
} | ||
|
||
export default translate(connect()(CustomOptionButton)); |
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