Skip to content

Commit

Permalink
v2.1.0 (#30)
Browse files Browse the repository at this point in the history
* fixed selfie capture

* comply changes with updated rahat-contracts

* Asset UI design integrated

* package list and details

* package details

* package-charge

* created charge context, not finished yet

* reworked charge module and its coreesponding routes,created Charge context, caliming charge error handling done

* NFT charge success now stores NFT details in index db

* updated Rahat domain

* Added coding style and contributing

* removed id

* User assets shows saved NFTS

Co-authored-by: Rasil Baidar <rasil.baidar@rumsan.com>
Co-authored-by: rojanbade <rojanbade@gmail.com>
Co-authored-by: Nishu Bade Shrestha <85993436+Nishubade@users.noreply.github.com>
  • Loading branch information
4 people authored Nov 26, 2021
1 parent f63950c commit 8945881
Show file tree
Hide file tree
Showing 38 changed files with 134,903 additions and 1,088 deletions.
4 changes: 0 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
id: Contribution Guidelines
---

**Namaste**, Rahat development team would like to thank you for taking the time to contribute! We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:
- Reporting a bug
- Discussing the current state of the code
Expand Down
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# vendor-web
Web-based Blockchain-based Wallet for Rahat vendors to signup and recieve tokens for beneficiaries.
# Introduction
Vendor app is a web-based Blockchain-based Wallet for Rahat vendors to signup and recieve tokens for beneficiaries.

_Important: This project is part of [Rahat Project](https://github.com/esatya/rahat). Please make sure you have setup Rahat service first._

# About Rahat
Rahat is a blockchain-based digital relief distribution management platform for humanitarian agencies to support marginalized communities. It issues, manages and monitors relief distribution in the form of digital tokens. It creates a transparent, efficient and cheaper way to distribute cash or goods. It mobilizes the local community encouraging financial resilience and freedom. For more information please visit https://rahat.esatya.io.
# Rahat
Rahat is a blockchain-based digital relief distribution management platform for humanitarian agencies to support marginalized communities. It issues, manages and monitors relief distribution in the form of digital tokens. It creates a transparent, efficient and cheaper way to distribute cash or goods. It mobilizes the local community encouraging financial resilience and freedom. For more information please visit https://rahat.io.

Rahat’s main features are:
- Dashboard for aid agencies to issue relief tokens to recipients & to onboard local community vendors. Agencies can audit all transactional information real-time.
Expand Down Expand Up @@ -74,3 +74,10 @@ To deploy this software on production

* you need a fully deployed [Rahat Server](https://github.com/esatya/rahat)
* update the rahat server api on ```client.json````
# Coding Styles
This repository uses eslint to enforce air-bnb coding styles.

# Contributing
Everyone is very welcome to contribute on the codebase of Rahat. Please reach us in Gitter in case of any query/feedback/suggestion.

For more information on the contributing procedure, see [Contribution](https://github.com/esatya/rahat-documentation/blob/main/CONTRIBUTING.md).
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"axios": "^0.24.0",
"bootstrap": "^4.5.1",
"crypto-js": "^4.0.0",
"dexie": "^3.0.3",
Expand Down
4 changes: 2 additions & 2 deletions public/assets/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -1290,8 +1290,8 @@ a.badge-dark {
margin: 0;
color: #27173E;
background: #fff;
border-top: 1px solid #DCDCE9;
border-bottom: 1px solid #DCDCE9;
/* border-top: 1px solid #DCDCE9;
border-bottom: 1px solid #DCDCE9; */
line-height: 1.3em
}

Expand Down
4 changes: 4 additions & 0 deletions src/actions/chargeActions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
SET_TOKEN_AMOUNT: 'SET_TOKEN_AMOUNT',
SET_NFT_AMOUNT: 'SET_NFT_AMOUNT'
};
19 changes: 11 additions & 8 deletions src/actionsheets/sheets/ChargeDetails.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useContext } from 'react';
import { useHistory } from 'react-router-dom';
import { Form } from 'react-bootstrap';
import Swal from 'sweetalert2';

Expand All @@ -9,6 +10,7 @@ import { ActionSheetContext } from '../../contexts/ActionSheetContext';
import ActionSheet from './ActionSheet';

export default function ChargeDetails(props) {
const history = useHistory();
const { onHide, showModal } = props;

const { showLoading, data, setData, setActiveSheet } = useContext(ActionSheetContext);
Expand All @@ -17,13 +19,14 @@ export default function ChargeDetails(props) {
const chargeCustomer = async () => {
showLoading('Charging customer account...');
try {
const agency = await DataService.getDefaultAgency();
const rahat = RahatService(agency.address, wallet);
let receipt = await rahat.chargeCustomer(data.phone, data.amount);
setData({ chargeTxHash: receipt.transactionHash });
setActiveSheet('otp');
// const agency = await DataService.getDefaultAgency();
// const rahat = RahatService(agency.address, wallet);
// let receipt = await rahat.chargeCustomer(data.phone, data.amount);
// setData({ chargeTxHash: receipt.transactionHash });
setActiveSheet('null');
history.push(`/charge/${data.phone}`);
} catch (e) {
console.log(e);
// console.log(e);
Swal.fire('Error', 'Transaction cancelled. Please try again.', 'error');
} finally {
showLoading(null);
Expand Down Expand Up @@ -56,7 +59,7 @@ export default function ChargeDetails(props) {
</div>
</div>

<div className="form-group basic">
{/* <div className="form-group basic">
<label className="label">Enter Amount</label>
<div className="input-group mb-3">
<div className="input-group-prepend">
Expand All @@ -74,7 +77,7 @@ export default function ChargeDetails(props) {
required
/>
</div>
</div>
</div> */}
</ActionSheet>
);
}
2 changes: 1 addition & 1 deletion src/actionsheets/sheets/Otp.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function ChargeDetails(props) {
await DataService.addTx(tx);
history.push(`/tx/${receipt.transactionHash}`);
} catch (e) {
console.log(e);
// console.log(e);
const tx = {
hash: data.chargeTxHash,
type: 'charge',
Expand Down
Loading

0 comments on commit 8945881

Please sign in to comment.