Browse Source

Merge #818

818: Improve closing Cfd message in the taker UI r=klochowicz a=klochowicz

- Present the timestamp in human-readable format instead of Unix time,
- use lowercase action name

Co-authored-by: Mariusz Klochowicz <mariusz@klochowicz.com>
release/0.3.1
bors[bot] 3 years ago
committed by GitHub
parent
commit
9704558ab2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      taker-frontend/src/components/CloseButton.tsx
  2. 5
      taker-frontend/src/components/Disclaimer.tsx

7
taker-frontend/src/components/CloseButton.tsx

@ -13,6 +13,7 @@ import {
} from "@chakra-ui/react"; } from "@chakra-ui/react";
import * as React from "react"; import * as React from "react";
import { Cfd, StateGroupKey, StateKey } from "../types"; import { Cfd, StateGroupKey, StateKey } from "../types";
import Timestamp from "./Timestamp";
interface Props { interface Props {
cfd: Cfd; cfd: Cfd;
@ -44,8 +45,10 @@ export default function CloseButton({ cfd, request, status, action }: Props) {
<PopoverCloseButton /> <PopoverCloseButton />
<PopoverBody> <PopoverBody>
<Text> <Text>
This will {action} your position with the counterparty. The exchange rate at {cfd This will {action.toLowerCase()} your position with the counterparty. The exchange rate at
.expiry_timestamp} </Text>
<Timestamp timestamp={cfd.expiry_timestamp} />
<Text>
will determine your profit/losses. It is likely that the rate will change until then. will determine your profit/losses. It is likely that the rate will change until then.
</Text> </Text>
</PopoverBody> </PopoverBody>

5
taker-frontend/src/components/Disclaimer.tsx

@ -1,3 +1,4 @@
import { ExternalLinkIcon } from "@chakra-ui/icons";
import { import {
Button, Button,
Link, Link,
@ -9,6 +10,7 @@ import {
ModalHeader, ModalHeader,
ModalOverlay, ModalOverlay,
Text, Text,
useColorModeValue,
useDisclosure, useDisclosure,
} from "@chakra-ui/react"; } from "@chakra-ui/react";
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
@ -21,6 +23,8 @@ export default function Disclaimer() {
const { isOpen, onOpen, onClose } = useDisclosure(); const { isOpen, onOpen, onClose } = useDisclosure();
const iconColor = useColorModeValue("white.200", "white.600");
useEffect(() => { useEffect(() => {
if (!ack) { if (!ack) {
onOpen(); onOpen();
@ -49,6 +53,7 @@ export default function Disclaimer() {
isExternal isExternal
> >
this guide! this guide!
<ExternalLinkIcon mx="2px" color={iconColor} />
</Link> </Link>
<Text>Additionally, CFD trading is inherently risky: so don't get rekt</Text> <Text>Additionally, CFD trading is inherently risky: so don't get rekt</Text>
</ModalBody> </ModalBody>

Loading…
Cancel
Save