-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into neil-AddWorkspaceRoom
- Loading branch information
Showing
72 changed files
with
1,011 additions
and
713 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
name: Contributor+ Checklist | ||
|
||
on: issue_comment | ||
on: pull_request_review | ||
|
||
jobs: | ||
checklist: | ||
runs-on: ubuntu-latest | ||
if: github.actor != 'OSBotify' && (contains(github.event.issue.pull_request.url, 'http') && github.event_name == 'issue_comment' && contains(github.event.comment.body, '- [')) | ||
if: github.actor != 'OSBotify' | ||
steps: | ||
- name: contributorChecklist.js | ||
uses: Expensify/App/.github/actions/javascript/contributorChecklist@andrew-checklist-3 | ||
uses: Expensify/App/.github/actions/javascript/contributorChecklist@main | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CHECKLIST: 'contributorPlus' |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
69 changes: 69 additions & 0 deletions
69
src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly.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,69 @@ | ||
import _ from 'underscore'; | ||
import React from 'react'; | ||
import {StyleSheet} from 'react-native'; | ||
import lodashGet from 'lodash/get'; | ||
import Str from 'expensify-common/lib/str'; | ||
import Text from '../Text'; | ||
import PressableWithSecondaryInteraction from '../PressableWithSecondaryInteraction'; | ||
import * as ReportActionContextMenu from '../../pages/home/report/ContextMenu/ReportActionContextMenu'; | ||
import * as ContextMenuActions from '../../pages/home/report/ContextMenu/ContextMenuActions'; | ||
import Tooltip from '../Tooltip'; | ||
import canUseTouchScreen from '../../libs/canUseTouchscreen'; | ||
import styles from '../../styles/styles'; | ||
import withWindowDimensions from '../withWindowDimensions'; | ||
import {propTypes, defaultProps} from './anchorForCommentsOnlyPropTypes'; | ||
|
||
/* | ||
* This is a default anchor component for regular links. | ||
*/ | ||
const BaseAnchorForCommentsOnly = (props) => { | ||
let linkRef; | ||
const rest = _.omit(props, _.keys(propTypes)); | ||
const linkProps = {}; | ||
if (_.isFunction(props.onPress)) { | ||
linkProps.onPress = props.onPress; | ||
} else { | ||
linkProps.href = props.href; | ||
} | ||
const defaultTextStyle = canUseTouchScreen() || props.isSmallScreenWidth ? {} : styles.userSelectText; | ||
|
||
return ( | ||
<PressableWithSecondaryInteraction | ||
inline | ||
onSecondaryInteraction={ | ||
(event) => { | ||
ReportActionContextMenu.showContextMenu( | ||
Str.isValidEmail(props.displayName) ? ContextMenuActions.CONTEXT_MENU_TYPES.EMAIL : ContextMenuActions.CONTEXT_MENU_TYPES.LINK, | ||
event, | ||
props.href, | ||
lodashGet(linkRef, 'current'), | ||
); | ||
} | ||
} | ||
> | ||
<Tooltip text={Str.isValidEmail(props.displayName) ? '' : props.href}> | ||
<Text | ||
ref={el => linkRef = el} | ||
style={StyleSheet.flatten([props.style, defaultTextStyle])} | ||
accessibilityRole="link" | ||
hrefAttrs={{ | ||
rel: props.rel, | ||
target: props.target, | ||
}} | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...linkProps} | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...rest} | ||
> | ||
{props.children} | ||
</Text> | ||
</Tooltip> | ||
</PressableWithSecondaryInteraction> | ||
); | ||
}; | ||
|
||
BaseAnchorForCommentsOnly.propTypes = propTypes; | ||
BaseAnchorForCommentsOnly.defaultProps = defaultProps; | ||
BaseAnchorForCommentsOnly.displayName = 'BaseAnchorForCommentsOnly'; | ||
|
||
export default withWindowDimensions(BaseAnchorForCommentsOnly); |
Oops, something went wrong.