-
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 branch 'main' of https://github.com/mkhutornyi/Expensify-Frontend…
… into fix-32865
- Loading branch information
Showing
62 changed files
with
1,716 additions
and
1,286 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 |
---|---|---|
|
@@ -17,6 +17,11 @@ jobs: | |
- name: Setup NodeJS | ||
uses: ./.github/actions/composite/setupNode | ||
|
||
- name: Set dummy git credentials | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Test" | ||
- name: Run performance testing script | ||
shell: bash | ||
run: | | ||
|
@@ -27,6 +32,7 @@ jobs: | |
npm install --force | ||
npx reassure --baseline | ||
git switch --force --detach - | ||
git merge --no-commit --allow-unrelated-histories "$BASELINE_BRANCH" -X ours | ||
npm install --force | ||
npx reassure --branch | ||
|
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "new.expensify", | ||
"version": "1.4.11-6", | ||
"version": "1.4.11-13", | ||
"author": "Expensify, Inc.", | ||
"homepage": "https://new.expensify.com", | ||
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", | ||
|
@@ -98,7 +98,7 @@ | |
"date-fns-tz": "^2.0.0", | ||
"dom-serializer": "^0.2.2", | ||
"domhandler": "^4.3.0", | ||
"expensify-common": "git+ssh://[email protected]/Expensify/expensify-common.git#ee14b3255da33d2b6924c357f43393251b6dc6d2", | ||
"expensify-common": "git+ssh://[email protected]/Expensify/expensify-common.git#927c8409e4454e15a1b95ed0a312ff8fee38f0f0", | ||
"fbjs": "^3.0.2", | ||
"htmlparser2": "^7.2.0", | ||
"idb-keyval": "^6.2.1", | ||
|
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 |
---|---|---|
@@ -1,43 +1,53 @@ | ||
import React, {Component} from 'react'; | ||
import {withNetwork} from '@components/OnyxProvider'; | ||
import React, {forwardRef, useImperativeHandle, useRef} from 'react'; | ||
import getQrCodeFileName from '@components/QRShare/getQrCodeDownloadFileName'; | ||
import {qrShareDefaultProps, qrSharePropTypes} from '@components/QRShare/propTypes'; | ||
import useNetwork from '@hooks/useNetwork'; | ||
import fileDownload from '@libs/fileDownload'; | ||
import QRShare from '..'; | ||
|
||
class QRShareWithDownload extends Component { | ||
qrShareRef = React.createRef(); | ||
|
||
constructor(props) { | ||
super(props); | ||
|
||
this.download = this.download.bind(this); | ||
} | ||
|
||
download() { | ||
return new Promise((resolve, reject) => { | ||
// eslint-disable-next-line es/no-optional-chaining | ||
const svg = this.qrShareRef.current?.getSvg(); | ||
if (svg == null) { | ||
return reject(); | ||
} | ||
|
||
svg.toDataURL((dataURL) => resolve(fileDownload(dataURL, getQrCodeFileName(this.props.title)))); | ||
}); | ||
} | ||
|
||
render() { | ||
return ( | ||
<QRShare | ||
ref={this.qrShareRef} | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...this.props} | ||
logo={this.props.network.isOffline ? null : this.props.logo} | ||
/> | ||
); | ||
} | ||
function QRShareWithDownload({innerRef, ...props}) { | ||
const {isOffline} = useNetwork(); | ||
const qrShareRef = useRef(null); | ||
|
||
useImperativeHandle( | ||
innerRef, | ||
() => ({ | ||
download: () => | ||
new Promise((resolve, reject) => { | ||
// eslint-disable-next-line es/no-optional-chaining | ||
const svg = qrShareRef.current?.getSvg(); | ||
if (svg == null) { | ||
return reject(); | ||
} | ||
|
||
svg.toDataURL((dataURL) => resolve(fileDownload(dataURL, getQrCodeFileName(props.title)))); | ||
}), | ||
}), | ||
[props.title], | ||
); | ||
|
||
return ( | ||
<QRShare | ||
ref={qrShareRef} | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...props} | ||
logo={isOffline ? null : props.logo} | ||
/> | ||
); | ||
} | ||
|
||
QRShareWithDownload.propTypes = qrSharePropTypes; | ||
QRShareWithDownload.defaultProps = qrShareDefaultProps; | ||
QRShareWithDownload.displayName = 'QRShareWithDownload'; | ||
|
||
const QRShareWithDownloadWithRef = forwardRef((props, ref) => ( | ||
<QRShareWithDownload | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...props} | ||
innerRef={ref} | ||
/> | ||
)); | ||
|
||
QRShareWithDownloadWithRef.displayName = 'QRShareWithDownloadWithRef'; | ||
|
||
export default withNetwork()(QRShareWithDownload); | ||
export default QRShareWithDownloadWithRef; |
Oops, something went wrong.