This repo is for developers who are looking to integrate EscrowMyEther on their site.
This repo is hosted on github pages: https://escrowmyetherbd.github.io/
There are several ways to integrate the buyer dashboard in your site. The easiest way is cloning this repository on github and running it on github pages, and replacing the github.io domain with your subdomain (dashboard.yoursite.com). For more info on setting up github pages, visit: https://pages.github.com/
EscrowMyEther is a static html/css/javascript/ReactJS site and a client-side interface to the escrow smart contract. No special hosting environment is required if you choose to copy the repo and run it on your site.
- Copy the "Source Files" folder
- Download node_modules.zip from this link: https://drive.google.com/open?id=0By0DAad8QzZAUjBDQ1VJQmZieTg
- Copy the extracted folder into "Source Files" folder
- Install NodeJS. v8.1.4 is recommended as it's used in the development of this Dapp.
- You can then modify the Dapp for your usage. The below commands will be helpful.
npm start - Start a local version of the Dapp in your browser localhost:3000. It automatically reloads the Dapp when you save any updates to the source files. Useful during development.
npm run build - Build an optimized version for deployment. A new folder called build_webpack will be created with the optimized version. You can upload the content of build_webpack directly to github pages for deployment.
- Head to source files > src > App.js
- Change line 6 from the first line to 2nd line:
import BuyerHome from "./BuyerHome"
import SellerHome from "./SellerHome"
-
On line 19, change "BuyerHome" to "SellerHome"
-
npm run build. You will build the static site for Seller dashboard.
Content of the Dapp is served within the root div. Any content added above this root div will show above the Dapp, like a header. Any content added below will display like a footer.
Css file for modifying styles.
The buyer dashboard page you see when visiting https://escrowmyetherbd.github.io/
The seller dashboard page
When you click "Initialize new transaction" on the dashboard, the right side changes to this page. This page should be modified if you wish to hardcode your address as the escrow agent or seller.
The right side of the dashboard changes to this page when an existing transaction is clicked.
Under Public > Index.html, the Dapp is rendered within the root div. Custom header and footers can be added above and below this div.
If you look to be the escrow agent for your site (example: Real estate agents, classified sites), you can remove the escrow agent input field and hardcode your address as the escrow agent.
To do this,
-
Open Source Files > src > NewTransactionRS.js.
-
Hardcode your address. In line 306, replace this.state.escrowAddress with your own address as follows:
- Remove the Escrow Address input field
Line 425 to 434 and 368 to 377 contains the Escrow Address input field. Remove both of them.
- Your address will then be the Escrow Agent for all transactions on your site.
If you need assistance integrating/modifying EsrowMyEther for your site, feel free to raise a github issue or contact me at escrowmyether[at]gmail[dot]com.
Cheung Ka Yin escrowmyether[at]gmail[dot]com