@cryptocadet/react-crypto-pay 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -17,10 +17,59 @@ React-Crypto-Pay requires [Node.js](https://nodejs.org/) v16+ to run.
17
17
  Install the dependencies and devDependencies and start the server.
18
18
 
19
19
  ```sh
20
- cd react-crypto-pay
21
- npm install
20
+ npm install @cryptocadet/react-crypto-pay @coinbase/wallet-sdk @walletconnect/ethereum-provider axios react react-dom styled-components web3modal
22
21
  ```
23
22
 
23
+ ## NextJS
24
+
25
+ In order to install for NextJS, the CryptoPay Modal must be imported dynamically:
26
+
27
+ ```sh
28
+ npm install @cryptocadet/react-crypto-pay @coinbase/wallet-sdk @walletconnect/ethereum-provider axios react react-dom styled-components web3modal
29
+ ```
30
+
31
+ Create a components folder within your app or src folder, and create a new file.
32
+
33
+ ```sh
34
+ import {CryptoPayModal} from 'react-crypto-pay'
35
+ const ComponentName = () => {
36
+
37
+ return (
38
+
39
+ <CryptoPayModal
40
+ apiKey={'YOUR_API_KEY'}
41
+ productId={'YOUR_PROD_ID'}
42
+ requireWalletConnection={true}
43
+ label="BUTTON TITLE"
44
+ />
45
+
46
+ )
47
+ }
48
+
49
+ export default ComponentName;
50
+ ```
51
+
52
+ In your page or index file, dynamically import the created component:
53
+
54
+ ```sh
55
+ export default function Home() {
56
+
57
+ const ComponentName = dynamic(() => import("./../components/ComponentName"), { ssr: false });
58
+
59
+ return (
60
+ <ComponentName />
61
+ )
62
+ ```
63
+
64
+ ## Styles
65
+
66
+ React Crypto Pay Modal style can be customized by targeting the cryptopaymodal and cryptopaybutton classes and the style tag in JSX. Web3Modal styles can be imported by adding the following in the component file:
67
+
68
+ ```sh
69
+ import 'react-crypto-pay/dist/style.css'
70
+ ```
71
+
72
+
24
73
  ## License
25
74
 
26
75
  MIT