Browse Source

Rename "Accept / Reject" to "Pending" in CfdTables

Pending is a more succinct nudge to the user that they should react with an
action to the CFDs inside these tables.
compile-for-aarch64
Mariusz Klochowicz 3 years ago
parent
commit
8b59895a05
No known key found for this signature in database GPG Key ID: 470C865699C8D4D
  1. 22
      frontend/src/MakerApp.tsx
  2. 12
      frontend/src/components/Types.tsx

22
frontend/src/MakerApp.tsx

@ -69,13 +69,9 @@ export default function App() {
},
});
const acceptOrRejectOrder = cfds.filter((value) => value.state.getGroup() === StateGroupKey.ACCEPT_OR_REJECT_ORDER);
const acceptOrRejectSettlement = cfds.filter((value) =>
value.state.getGroup() === StateGroupKey.ACCEPT_OR_REJECT_SETTLEMENT
);
const acceptOrRejectRollOvers = cfds.filter((value) =>
value.state.getGroup() === StateGroupKey.ACCEPT_OR_REJECT_ROLL_OVER
);
const pendingOrders = cfds.filter((value) => value.state.getGroup() === StateGroupKey.PENDING_ORDER);
const pendingSettlements = cfds.filter((value) => value.state.getGroup() === StateGroupKey.PENDING_SETTLEMENT);
const pendingRollOvers = cfds.filter((value) => value.state.getGroup() === StateGroupKey.PENDING_ROLL_OVER);
const opening = cfds.filter((value) => value.state.getGroup() === StateGroupKey.OPENING);
const open = cfds.filter((value) => value.state.getGroup() === StateGroupKey.OPEN);
const closed = cfds.filter((value) => value.state.getGroup() === StateGroupKey.CLOSED);
@ -166,9 +162,9 @@ export default function App() {
<Tabs marginTop={5}>
<TabList>
<Tab>Open [{open.length}]</Tab>
<Tab>Accept / Reject Order [{acceptOrRejectOrder.length}]</Tab>
<Tab>Accept / Reject Settlement [{acceptOrRejectSettlement.length}]</Tab>
<Tab>Accept / Reject Roll Overs [{acceptOrRejectRollOvers.length}]</Tab>
<Tab>Pending Orders [{pendingOrders.length}]</Tab>
<Tab>Pending Settlements [{pendingSettlements.length}]</Tab>
<Tab>Pending Roll Overs [{pendingRollOvers.length}]</Tab>
<Tab>Opening [{opening.length}]</Tab>
<Tab>Closed [{closed.length}]</Tab>
</TabList>
@ -178,13 +174,13 @@ export default function App() {
<CfdTable data={open} />
</TabPanel>
<TabPanel>
<CfdTable data={acceptOrRejectOrder} />
<CfdTable data={pendingOrders} />
</TabPanel>
<TabPanel>
<CfdTable data={acceptOrRejectSettlement} />
<CfdTable data={pendingSettlements} />
</TabPanel>
<TabPanel>
<CfdTable data={acceptOrRejectRollOvers} />
<CfdTable data={pendingRollOvers} />
</TabPanel>
<TabPanel>
<CfdTable data={opening} />

12
frontend/src/components/Types.tsx

@ -132,7 +132,7 @@ export class State {
public getGroup(): StateGroupKey {
switch (this.key) {
case StateKey.INCOMING_ORDER_REQUEST:
return StateGroupKey.ACCEPT_OR_REJECT_ORDER;
return StateGroupKey.PENDING_ORDER;
case StateKey.OUTGOING_ORDER_REQUEST:
case StateKey.ACCEPTED:
@ -150,10 +150,10 @@ export class State {
return StateGroupKey.OPEN;
case StateKey.INCOMING_SETTLEMENT_PROPOSAL:
return StateGroupKey.ACCEPT_OR_REJECT_SETTLEMENT;
return StateGroupKey.PENDING_SETTLEMENT;
case StateKey.INCOMING_ROLL_OVER_PROPOSAL:
return StateGroupKey.ACCEPT_OR_REJECT_ROLL_OVER;
return StateGroupKey.PENDING_ROLL_OVER;
case StateKey.REJECTED:
case StateKey.REFUNDED:
@ -199,11 +199,11 @@ const enum StateKey {
export enum StateGroupKey {
/// A CFD which is still being set up (not on chain yet)
OPENING = "Opening",
ACCEPT_OR_REJECT_ORDER = "Accept / Reject Order",
PENDING_ORDER = "Pending Order",
/// A CFD that is an ongoing open position (on chain)
OPEN = "Open",
ACCEPT_OR_REJECT_SETTLEMENT = "Accept / Reject Settlement",
ACCEPT_OR_REJECT_ROLL_OVER = "Accept / Reject Roll Over",
PENDING_SETTLEMENT = "Pending Settlement",
PENDING_ROLL_OVER = "Pending Roll Over",
/// A CFD that has been successfully or not-successfully terminated
CLOSED = "Closed",
}

Loading…
Cancel
Save