-
Notifications
You must be signed in to change notification settings - Fork 175
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 #2979 from near/wep-204
feat: Disable new account creation in NW
- Loading branch information
Showing
17 changed files
with
1,783 additions
and
41 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
84 changes: 84 additions & 0 deletions
84
packages/frontend/src/components/common/wallet_selector/MoreNearWalletsModal.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,84 @@ | ||
import React from 'react'; | ||
import { Translate } from 'react-localize-redux'; | ||
import styled from 'styled-components'; | ||
|
||
import AlertTriangleIcon from '../../svg/AlertTriangleIcon'; | ||
import FormButton from '../FormButton'; | ||
import Modal from '../modal/Modal'; | ||
import ModalFooter from '../modal/ModalFooter'; | ||
|
||
const StyledContainer = styled.div` | ||
.more-wallets-body { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
text-align: center; | ||
h3 { | ||
margin: 25px 0; | ||
} | ||
p { | ||
margin-top: 0; | ||
line-height: 21px; | ||
} | ||
} | ||
.alert-triangle { | ||
margin-top: 40px; | ||
background-color: #FFF8F8; | ||
border-radius: 50%; | ||
width: 60px; | ||
height: 60px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
> svg { | ||
min-width: 21px; | ||
min-height: 21px; | ||
} | ||
} | ||
&& { | ||
.modal-footer { | ||
display: flex; | ||
flex-direction: column; | ||
button { | ||
&.link { | ||
margin-top: 20px; | ||
} | ||
} | ||
} | ||
} | ||
`; | ||
|
||
const MoreNearWalletsModal = ({ open, onClose, onClickSeeMoreWallets }) => { | ||
return ( | ||
<Modal | ||
id='more-near-wallets-modal' | ||
isOpen={open} | ||
onClose={onClose} | ||
closeButton='desktop' | ||
modalSize='sm-md' | ||
> | ||
<StyledContainer> | ||
<div className='more-wallets-body'> | ||
<div className='alert-triangle'><AlertTriangleIcon color='#E5484D' /></div> | ||
<h3><Translate id='moreNearWalletsModal.title' /></h3> | ||
<p><Translate id='moreNearWalletsModal.desc' /></p> | ||
</div> | ||
<ModalFooter> | ||
<FormButton onClick={onClickSeeMoreWallets}> | ||
<Translate id='moreNearWalletsModal.primaryButton' /> | ||
</FormButton> | ||
<FormButton color='link' id='close-button'> | ||
<Translate id='button.dismiss' /> | ||
</FormButton> | ||
</ModalFooter> | ||
</StyledContainer> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default MoreNearWalletsModal; |
76 changes: 76 additions & 0 deletions
76
packages/frontend/src/components/common/wallet_selector/WalletSelectorGetAWallet.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,76 @@ | ||
import { setupCoin98Wallet } from '@near-wallet-selector/coin98-wallet'; | ||
import { setupWalletSelector } from '@near-wallet-selector/core'; | ||
import { setupHereWallet } from '@near-wallet-selector/here-wallet'; | ||
import { setupLedger } from '@near-wallet-selector/ledger'; | ||
import { setupMathWallet } from '@near-wallet-selector/math-wallet'; | ||
import { setupMeteorWallet } from '@near-wallet-selector/meteor-wallet'; | ||
import { setupModal } from '@near-wallet-selector/modal-ui'; | ||
import { setupMyNearWallet } from '@near-wallet-selector/my-near-wallet'; | ||
import { setupNearWallet } from '@near-wallet-selector/near-wallet'; | ||
import { setupNearFi } from '@near-wallet-selector/nearfi'; | ||
import { setupNightly } from '@near-wallet-selector/nightly'; | ||
import { setupOptoWallet } from '@near-wallet-selector/opto-wallet'; | ||
import { setupSender } from '@near-wallet-selector/sender'; | ||
import { setupWelldoneWallet } from '@near-wallet-selector/welldone-wallet'; | ||
import React, { useEffect } from 'react'; | ||
|
||
import { IS_MAINNET } from '../../../config'; | ||
import MoreNearWalletsModal from './MoreNearWalletsModal'; | ||
import '@near-wallet-selector/modal-ui/styles.css'; | ||
|
||
// This Wallet Selector component is for displaying a list of available wallets only. | ||
// The Wallet Selector CSS has been modified to omit the 'Connect a wallet' section. | ||
|
||
export function WalletSelectorGetAWallet({ | ||
setWalletSelectorModal, | ||
showModal, | ||
setShowModal | ||
}) { | ||
|
||
const walletWrapperDiv = document.getElementById('near-wallet-selector-modal'); | ||
walletWrapperDiv?.classList.add('wallet-selector-get-a-wallet-modal'); | ||
|
||
useEffect(() => { | ||
|
||
const initSelector = async () => { | ||
const selector = await setupWalletSelector({ | ||
network: IS_MAINNET ? 'mainnet' : 'testnet', | ||
modules: [ | ||
setupNearWallet(), | ||
setupMyNearWallet(), | ||
setupSender(), | ||
setupHereWallet(), | ||
setupMathWallet(), | ||
setupNightly(), | ||
setupMeteorWallet(), | ||
setupWelldoneWallet(), | ||
setupLedger(), | ||
setupNearFi(), | ||
setupCoin98Wallet(), | ||
setupOptoWallet() | ||
], | ||
}); | ||
|
||
setWalletSelectorModal(setupModal(selector, { | ||
contractId: 'dontcare' | ||
})); | ||
}; | ||
|
||
initSelector(); | ||
|
||
}, []); | ||
|
||
return ( | ||
<> | ||
{ | ||
showModal && ( | ||
<MoreNearWalletsModal | ||
open={showModal} | ||
onClose={() => setShowModal(null)} | ||
onClickSeeMoreWallets={() => setShowModal('wallet-selector')} | ||
/> | ||
) | ||
} | ||
</> | ||
); | ||
}; |
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.