Bladeren bron

In case something broke

backup
BinHong Lee 6 jaren geleden
bovenliggende
commit
4b8d47a13a
Getekend door: binhong <binhong@binhong.me> GPG sleutel-ID: 6B4C5608EC620D19
6 gewijzigde bestanden met toevoegingen van 86 en 0 verwijderingen
  1. +20
    -0
      docs/App.md
  2. +11
    -0
      docs/Message.md
  3. +8
    -0
      docs/Payment.md
  4. +9
    -0
      docs/PaymentChain.md
  5. +22
    -0
      docs/People.md
  6. +16
    -0
      docs/index.md

+ 20
- 0
docs/App.md Bestand weergeven

@@ -0,0 +1,20 @@
# App.js

### State

| State names | Details |
|:---------------|:--------|
| `peoples` | Array of [`People`](People.md) component |
| `info` | Array for information of all the people involved |
| `paymentChain` | Generated return by the backend server |
| `actionButtons` | Just to store (and display) the 2 given buttons |
| `showResults` | Boolean that will be switched when result is received from server |

### Functions

| Function names | Details |
|:---------------|:--------|
| `getPaymentChain()` | Parse user input into JSON to be sent to backend and decipher the response from backend |
| `populatePeople(e)` | Fill `peoples` in `{this.state}` with `People` component based on user input in `Main-form` class |
| `updateInfo(e)` | Binded to each [`People`](people.md) as to update `{this.state.info}` when something in the [`People`](people.md) class is updated |
| `httpPost(data, callback)` | Used by `getPaymentChain()` to make `POST` request to [api.breakups.life/paymentChain](https://api.breakups.life) |

+ 11
- 0
docs/Message.md Bestand weergeven

@@ -0,0 +1,11 @@
# Message.js

This just returns the following and do nothing else.

```HTML
<div className="Message">
<br/>
Calculating...
<br/>
</div>
```

+ 8
- 0
docs/Payment.md Bestand weergeven

@@ -0,0 +1,8 @@
# Payment.js

This returns a single payment among the [`PaymentChain`](PaymentChain.md) generated by [Breakups](https://breakups.life) where it specifies who to who and the amount below.

Example:

> Person A -> Person B <br/>
> Amount: 10.50

+ 9
- 0
docs/PaymentChain.md Bestand weergeven

@@ -0,0 +1,9 @@
# PaymentChain.js

This returns the entire list of [`Payment`](Payment.md)s generated by [Breakups](https://breakups.life).

### Props

| Props name | Details |
|:---------------|:--------|
| `payments` | Return JSON from [`Breakups`](https://api.breakups.life) which was then parsed into individual [`Payment`](Payment.md) component |

+ 22
- 0
docs/People.md Bestand weergeven

@@ -0,0 +1,22 @@
# People.js

### Refs

| Refs names | Details |
|:---------------|:--------|
| `name` | Name of the person |
| `email` | Email of the person |
| `amount` | Amount of money paid by the person |

### Relevant variables

| Variable names | Details |
|:---------------|:--------|
| `req` | An object containing `name`, `email`, and `amount` from the above |
| `infoToSend` | An object containing `{this.props.id}` in `id` and `req` in `info` |

### Props

| Props name | Details |
|:---------------|:--------|
| `info` | Just `infoToSend` |

+ 16
- 0
docs/index.md Bestand weergeven

@@ -0,0 +1,16 @@
## The frontend interface as a webapp for [Breakups](https://git.binhong.me/binhong/Breakups).

#### main

| API doc | source |
|:-------:|:------:|
| [App.js](App.md) | ([source](https://git.binhong.me/binhong/breakups-webapp/src/branch/master/src/App.js)) |

#### Components

| API doc | source |
|:-------:|:------:|
| [Message.js](Message.md) |([source](https://git.binhong.me/binhong/breakups-webapp/src/branch/master/src/Components/Message.js)) |
| [Payment.js](Payment.md) | ([source](https://git.binhong.me/binhong/breakups-webapp/src/branch/master/src/Components/Payment.js)) |
| [PaymentChain.js](PaymentChain.md) | ([source](https://git.binhong.me/binhong/breakups-webapp/src/branch/master/src/Components/PaymentChain.js)) |
| [People.js](People.md) | ([source](https://git.binhong.me/binhong/breakups-webapp/src/branch/master/src/Components/People.js)) |

Laden…
Annuleren
Opslaan