-
Notifications
You must be signed in to change notification settings - Fork 13
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 #410 from rnsdomains/develop
Release v2.1.3
- Loading branch information
Showing
31 changed files
with
349 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
import { combineReducers } from 'redux'; | ||
import { connectRouter } from 'connected-react-router'; | ||
import tabReducers from './tabs'; | ||
import authReducer from './auth'; | ||
import notificationReducer from './notifications'; | ||
import browserNotificationsReducer from './browerNotifications'; | ||
import multilanguage from './multilanguageReducer'; | ||
|
||
import newAdmin from './tabs/newAdmin/reducer'; | ||
import registrar from './tabs/registrar/reducer'; | ||
import resolve from './tabs/resolve/reducer'; | ||
import search from './tabs/search/reducer'; | ||
|
||
const rootReducer = history => combineReducers({ | ||
...tabReducers, | ||
auth: authReducer, | ||
notifications: notificationReducer, | ||
browserNotifications: browserNotificationsReducer, | ||
router: connectRouter(history), | ||
multilanguage, | ||
newAdmin, | ||
notifications: notificationReducer, | ||
registrar, | ||
resolve, | ||
router: connectRouter(history), | ||
search, | ||
}); | ||
|
||
export default rootReducer; |
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,62 @@ | ||
import React, { useState } from 'react'; | ||
import { multilanguage } from 'redux-multilanguage'; | ||
import propTypes from 'prop-types'; | ||
import { Carousel, Row, Col } from 'react-bootstrap'; | ||
|
||
const WalletCarousel = ({ wallets, strings }) => { | ||
const [index, setIndex] = useState(0); | ||
|
||
const handleSelect = (selectedIndex) => { | ||
setIndex(selectedIndex); | ||
}; | ||
|
||
/** | ||
* Group the wallets into 3s: | ||
*/ | ||
const walletsByThree = []; | ||
wallets.forEach((wallet, i) => { | ||
if (i % 3 === 0) { | ||
// new set | ||
walletsByThree[Math.floor(i / 3)] = [wallet]; | ||
} else { | ||
walletsByThree[Math.floor(i / 3)].push(wallet); | ||
} | ||
}); | ||
|
||
const SingleItem = item => ( | ||
<Col key={item.name}> | ||
<a href={item.link} target="_blank" rel="noopener noreferrer"> | ||
<div className="image-container" style={{ backgroundImage: `url(${item.image})` }} /> | ||
<p>{item.name}</p> | ||
</a> | ||
</Col> | ||
); | ||
|
||
return ( | ||
<div className="supported-wallets"> | ||
<h2>{strings.rns_integrations}</h2> | ||
<Carousel activeIndex={index} onSelect={handleSelect} controls className="wallet-carousel"> | ||
{walletsByThree.map(walletGroup => ( | ||
<Carousel.Item key={walletGroup[0].name}> | ||
<Row> | ||
{walletGroup.map(wallet => SingleItem(wallet))} | ||
</Row> | ||
</Carousel.Item> | ||
))} | ||
</Carousel> | ||
</div> | ||
); | ||
}; | ||
|
||
WalletCarousel.propTypes = { | ||
wallets: propTypes.arrayOf(propTypes.shape({ | ||
name: propTypes.string.isRequired, | ||
link: propTypes.string.isRequired, | ||
image: propTypes.string.isRequired, | ||
})).isRequired, | ||
strings: propTypes.shape({ | ||
rns_integrations: propTypes.string.isRequired, | ||
}).isRequired, | ||
}; | ||
|
||
export default multilanguage(WalletCarousel); |
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,58 @@ | ||
import React from 'react'; | ||
import { mount } from 'enzyme'; | ||
import { Provider } from 'react-redux'; | ||
import { mockStoreEnglish } from '../../../../../tests/config/mockStore'; | ||
import WalletCarousel from './WalletCarousel'; | ||
|
||
describe('WalletCarousel', () => { | ||
const wallet = i => ({ name: `name${i}`, image: `image${i}.jpg`, link: `url${i}` }); | ||
const wallets2 = [wallet(1), wallet(2)]; | ||
const wallets7 = [wallet(1), wallet(2), wallet(3), wallet(4), wallet(5), wallet(6), wallet(7)]; | ||
|
||
const store = mockStoreEnglish(); | ||
const generateComponent = wallets => ( | ||
<Provider store={store}><WalletCarousel wallets={wallets} /></Provider> | ||
); | ||
|
||
describe('basic', () => { | ||
it('renders', () => { | ||
const component = mount(generateComponent(wallets2)); | ||
expect(component).toBeDefined(); | ||
}); | ||
|
||
it('has header', () => { | ||
const component = mount(generateComponent(wallets2)); | ||
expect(component.find('h2').text()).toBe('Wallet and dapp integrations'); | ||
}); | ||
}); | ||
|
||
describe('content', () => { | ||
it('displays the correct content for first item', () => { | ||
const component = mount(generateComponent(wallets2)); | ||
|
||
const first = component.find('.carousel-item').find('.col').at(0); | ||
|
||
expect(first.find('p').text()).toBe('name1'); | ||
expect(first.find('a').props().href).toBe('url1'); | ||
expect(first.find('.image-container').props().style).toMatchObject({ backgroundImage: 'url(image1.jpg)' }); | ||
}); | ||
|
||
it('displays name of sixth item', () => { | ||
const component = mount(generateComponent(wallets7)); | ||
const column = component.find('.carousel-item').at(1).find('.col').at(2); | ||
expect(column.find('p').text()).toBe('name6'); | ||
}); | ||
}); | ||
|
||
describe('number of items', () => { | ||
it('creates 3 pages', () => { | ||
const component = mount(generateComponent(wallets7)); | ||
expect(component.find('.carousel-item')).toHaveLength(3); | ||
}); | ||
|
||
it('creates 1 page', () => { | ||
const component = mount(generateComponent(wallets2)); | ||
expect(component.find('.carousel-item')).toHaveLength(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
[ | ||
{ | ||
"name":"MyCrypto", | ||
"image":"https://rsk.co/img/wallets/1-mycrypto.png", | ||
"link":"https://mycrypto.com/account" | ||
}, | ||
{ | ||
"name":"Math Wallet", | ||
"image":"https://developers.rsk.co/assets/img/rsk/wallets/MathWallet_Logo_Vertical_Black.png", | ||
"link":"https://mathwallet.org/en-us/" | ||
}, | ||
{ | ||
"name":"Nifty Wallet", | ||
"image":"https://lh3.googleusercontent.com/vzJy_6bmNXDfiwFePYMfKPjfLMJsQFzEz5Ot3dtZ9Pk_0kPyLifJuQ0n5DnUoUGuKbOhTkkcX_ZyuJOaPaawHT0D=w128-h128-e365-rj-sc0x00ffffff", | ||
"link":"https://chrome.google.com/webstore/detail/nifty-wallet/jbdaocneiiinmjbjlgalhcelgbejmnid?hl=en" | ||
}, | ||
{ | ||
"name":"D'cent Wallet", | ||
"image":"https://rsk.co/img/wallets/5-dcent.png", | ||
"link":"https://dcentwallet.com/" | ||
}, | ||
{ | ||
"name":"Defiant Wallet", | ||
"image":"https://developers.rsk.co/assets/img/rsk/wallets/defiant-logo.png", | ||
"link":"https://www.defiantapp.tech/" | ||
}, | ||
{ | ||
"name":"Money on Chain", | ||
"image":"https://moneyonchain.com/wp-content/uploads/2020/06/isologochico.png", | ||
"link":"https://moneyonchain.com/" | ||
}, | ||
{ | ||
"name":"RIF on Chain", | ||
"image":"https://moneyonchain.com/wp-content/uploads/2020/10/logo_roc.svg", | ||
"link":"https://moneyonchain.com/rif-on-chain/" | ||
}, | ||
{ | ||
"name":"Bleumi Pay", | ||
"image":"https://bleumi.com/uploads-ssl.webflow.com/5f0ea53e824f8d2cd161752e/5f0ed8885e1b0e32974f7bf6_Bleumi_dark.png", | ||
"link":"https://bleumi.com/" | ||
}, | ||
{ | ||
"name":"rWallet", | ||
"image":"https://developers.rsk.co/assets/img/rsk_logo.svg", | ||
"link":"https://developers.rsk.co/wallet/rwallet/" | ||
} | ||
] |
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
2 changes: 1 addition & 1 deletion
2
src/app/tabs/newAdmin/addresses/containers/MigrateToMultiResolverContainer.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
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
Oops, something went wrong.