Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@transferwise/comparison-components
Advanced tools
Display a comparison table of providers given a route and amount.
React components for Comparison.
The comparison components are currently used in multiple places including:
The easiest way to use Comparison Components
within an application is by using the Web Widget / Universal Loader™.
Please see the docs here for more details.
Alternatively, you can install this React widget as an npm module running:
yarn add @transferwise/comparison-components
Written using React and built using Webpack and rollup.
To see and develop with the components locally run yarn storybook
.
The demo page contains the two different components Comparison and Table, one underneath the other.
We are currently using node 16 as a limitaion of working with webpack 4, so we use Volta to assist in setting Node version. but feel free to use another tool, or set the node version manually.
// example/index.js
import React from 'react';
import ReactDOM from 'react-dom';
import { Comparison } from '../src/';
const Root = () => {
return (
<div>
<Comparison
sourceCurrency="EUR" // required
targetCurrency="GBP" // required
sendAmount={5000} // required
source="EUR" // deprecated
target="GBP" // deprecated
amount={5000} // deprecated
providers={['transferwise', 'deutsche-bank', 'commerzbank']}
sourceCountry="de"
providerCountry="de"
maxVisibleProviders={5}
expandDisclaimer
affiliateLink="http://transferwise.evyy.net/c/111111/22222/333"
/>
</div>
);
};
ReactDOM.render(<Root />, document.getElementById('root'));
lang
: string
ISO 639-1. Default en
sourceCountry
: string
ISO 3166-1 alpha-2. Filter results by source country. i.e the origin country from where a user may want to send money from.providerCountry
: string
ISO 3166-1 alpha-2. Filter by provider country. i.e the country which the provider belongs to (e.g Natwest - GB, ANZ - AU). This property is also useful for only showing national banks, rather than "global" providers (like Western Union, Moneygram etc)maxVisibleProviders
: number
by default shows 3 providers and the rest are hidden under Show more providers link.expandDisclaimer
: boolean
will render the table with the disclaimer already opened and scrolls the element into the visible area of the browser windowaffiliateLink
: string
Affiliate tracking link.trackEvent
: func(eventName, trackingAttributes)
is called on user interaction with the table and other table based events (for example, user changes the send amount or views at least 50% of the table).trackLeavePageEvent
: func(eventName, trackingAttributes, callback)
is called on page exit events (for example, on click to CTA).All attributes are valid for <Comparison /> <ComparisonTable />
components
yarn storybook - runs storybook on 9001
yarn test - runs `jest` for Comparison Table
yarn run build-web - compiles the standalone comparison widget
yarn run build-npm - compiles UMD and ES bundles for distribution on NPM
Do not forget to update the version number in package.json
when committing changes.
The project has webpack-bundle-analyzer
and rollup-plugin-visualizer
set up to inspect the compiled bundle files. They can be accessed by setting the environment variable ANALYZE
and running the build command as normal.
$ ANALYZE=true yarn build-web
# Note this will open several browser tabs, one for each bundle
$ ANALYZE=true yarn build-npm
To create a new Comparison Component that can be imported by others, the following changes are required:
~/src/new-component
.stories.js
file in the folder to show the component in Storybook~/src/index.js
: make the component a named export~/rollup.config.js
: add a new input
~/webpack.config.npm.umd.js
: add a new componentEntry()
~/CODEOWNERS.md
: make comparison team and your team owners of the ~/src/new-component
folderHow translations working in comparison components
Read more about how tracking is working here.
FAQs
Display a comparison table of providers given a route and amount.
The npm package @transferwise/comparison-components receives a total of 85 weekly downloads. As such, @transferwise/comparison-components popularity was classified as not popular.
We found that @transferwise/comparison-components demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.