-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/swaps-amount-view-use-max
- Loading branch information
Showing
48 changed files
with
215 additions
and
146 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
28 changes: 16 additions & 12 deletions
28
app/components/Base/RemoteImage/__snapshots__/index.test.js.snap
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,18 +1,22 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`RemoteImage should render correctly 1`] = ` | ||
<View | ||
style={Object {}} | ||
<ComponentErrorBoundary | ||
componentLabel="RemoteImage-SVG" | ||
> | ||
<SvgCssUri | ||
height="100%" | ||
source={ | ||
Object { | ||
"uri": "https://raw.githubusercontent.com/MetaMask/eth-contract-metadata/master/images/dai.svg", | ||
<View | ||
style={Object {}} | ||
> | ||
<SvgCssUri | ||
height="100%" | ||
source={ | ||
Object { | ||
"uri": "https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/dai.svg", | ||
} | ||
} | ||
} | ||
uri="https://raw.githubusercontent.com/MetaMask/eth-contract-metadata/master/images/dai.svg" | ||
width="100%" | ||
/> | ||
</View> | ||
uri="https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/dai.svg" | ||
width="100%" | ||
/> | ||
</View> | ||
</ComponentErrorBoundary> | ||
`; |
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
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,41 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import Logger from '../../../util/Logger'; | ||
|
||
class ComponentErrorBoundary extends React.Component { | ||
state = { error: null }; | ||
|
||
static propTypes = { | ||
/** | ||
* Component to be used when there is no error | ||
*/ | ||
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]), | ||
/** | ||
* Component label for logging | ||
*/ | ||
componentLabel: PropTypes.string.isRequired, | ||
/** | ||
* Function to be called when there is an error | ||
*/ | ||
onError: PropTypes.func | ||
}; | ||
|
||
static getDerivedStateFromError(error) { | ||
return { error }; | ||
} | ||
|
||
componentDidCatch(error, errorInfo) { | ||
// eslint-disable-next-line no-unused-expressions | ||
this.props.onError?.(); | ||
|
||
Logger.error(error, { View: this.props.componentLabel, ...errorInfo }); | ||
} | ||
|
||
getErrorMessage = () => `Component: ${this.props.componentLabel}\n${this.state.error.toString()}`; | ||
|
||
render() { | ||
return this.state.error ? null : this.props.children; | ||
} | ||
} | ||
|
||
export default ComponentErrorBoundary; |
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
Oops, something went wrong.