-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 #23702 from Expensify/neil-secondary-members
Show info about workspace members added by secondary logins
- Loading branch information
Showing
10 changed files
with
160 additions
and
28 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,73 @@ | ||
import React from 'react'; | ||
import _ from 'underscore'; | ||
import PropTypes from 'prop-types'; | ||
import {View} from 'react-native'; | ||
import styles from '../styles/styles'; | ||
import Icon from './Icon'; | ||
import * as Expensicons from './Icon/Expensicons'; | ||
import DotIndicatorMessage from './DotIndicatorMessage'; | ||
import Tooltip from './Tooltip'; | ||
import CONST from '../CONST'; | ||
import * as StyleUtils from '../styles/StyleUtils'; | ||
import PressableWithoutFeedback from './Pressable/PressableWithoutFeedback'; | ||
import stylePropTypes from '../styles/stylePropTypes'; | ||
import useLocalize from '../hooks/useLocalize'; | ||
|
||
const propTypes = { | ||
/* The messages to display */ | ||
messages: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object]))])), | ||
|
||
/* The type of message, 'error' shows a red dot, 'success' shows a green dot */ | ||
type: PropTypes.oneOf(['error', 'success']).isRequired, | ||
|
||
/** A function to run when the X button next to the message is clicked */ | ||
onClose: PropTypes.func, | ||
|
||
/** Additional style object for the container */ | ||
containerStyles: stylePropTypes, | ||
|
||
/** Whether we can dismiss the messages */ | ||
canDismiss: PropTypes.bool, | ||
}; | ||
|
||
const defaultProps = { | ||
messages: {}, | ||
onClose: () => {}, | ||
containerStyles: [], | ||
canDismiss: true, | ||
}; | ||
|
||
function MessagesRow({messages, type, onClose, containerStyles, canDismiss}) { | ||
const {translate} = useLocalize(); | ||
if (_.isEmpty(messages)) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<View style={StyleUtils.combineStyles(styles.flexRow, styles.alignItemsCenter, containerStyles)}> | ||
<DotIndicatorMessage | ||
style={[styles.flex1]} | ||
messages={messages} | ||
type={type} | ||
/> | ||
{canDismiss && ( | ||
<Tooltip text={translate('common.close')}> | ||
<PressableWithoutFeedback | ||
onPress={onClose} | ||
style={[styles.touchableButtonImage]} | ||
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON} | ||
accessibilityLabel={translate('common.close')} | ||
> | ||
<Icon src={Expensicons.Close} /> | ||
</PressableWithoutFeedback> | ||
</Tooltip> | ||
)} | ||
</View> | ||
); | ||
} | ||
|
||
MessagesRow.propTypes = propTypes; | ||
MessagesRow.defaultProps = defaultProps; | ||
MessagesRow.displayName = 'MessagesRow'; | ||
|
||
export default MessagesRow; |
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
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 |
---|---|---|
|
@@ -155,6 +155,10 @@ export default { | |
marginLeft: 32, | ||
}, | ||
|
||
ml9: { | ||
marginLeft: 36, | ||
}, | ||
|
||
ml10: { | ||
marginLeft: 40, | ||
}, | ||
|