From a710a1b33a3ad228927a5144dbc01581fb2e823b Mon Sep 17 00:00:00 2001 From: Taranto Date: Sat, 24 Oct 2020 10:49:51 +0100 Subject: [PATCH] fix: typos and small ui improvements --- .../components/buttons/SupportLinkButton.js | 38 +++++++++++++++++++ .../src/components/buttons/index.js | 4 +- .../src/pages/Cashout/WizardStep.js | 12 +++--- .../{Cashboxes.js => CashCassettes.js} | 8 ++-- ...oxes.styles.js => CashCassettes.styles.js} | 0 .../src/pages/OperatorInfo/ContactInfo.js | 22 ++--------- .../ReceiptPrinting/ReceiptPrinting.js | 4 +- .../src/pages/Services/schemas/itbit.js | 4 +- .../src/pages/Services/schemas/twilio.js | 4 +- .../src/pages/Transactions/DetailsCard.js | 2 +- .../src/pages/Triggers/Triggers.js | 6 +-- .../src/pages/Wizard/components/Twilio.js | 11 ++++-- .../pages/Wizard/components/Wallet/AllSet.js | 2 +- .../Wizard/components/Wallet/Blockcypher.js | 17 +++------ .../components/Wallet/ChooseExchange.js | 27 ++++--------- .../Wizard/components/Wallet/ChooseWallet.js | 38 +++++-------------- new-lamassu-admin/src/routing/routes.js | 12 +++--- 17 files changed, 102 insertions(+), 109 deletions(-) create mode 100644 new-lamassu-admin/src/components/buttons/SupportLinkButton.js rename new-lamassu-admin/src/pages/Maintenance/{Cashboxes.js => CashCassettes.js} (95%) rename new-lamassu-admin/src/pages/Maintenance/{Cashboxes.styles.js => CashCassettes.styles.js} (100%) diff --git a/new-lamassu-admin/src/components/buttons/SupportLinkButton.js b/new-lamassu-admin/src/components/buttons/SupportLinkButton.js new file mode 100644 index 00000000..296a50ab --- /dev/null +++ b/new-lamassu-admin/src/components/buttons/SupportLinkButton.js @@ -0,0 +1,38 @@ +import { makeStyles } from '@material-ui/core' +import React from 'react' + +import { ActionButton } from 'src/components/buttons' +import { ReactComponent as InverseLinkIcon } from 'src/styling/icons/action/external link/white.svg' +import { ReactComponent as LinkIcon } from 'src/styling/icons/action/external link/zodiac.svg' +import { spacer, primaryColor } from 'src/styling/variables' + +const useStyles = makeStyles({ + actionButton: { + marginBottom: spacer * 4 + }, + actionButtonLink: { + textDecoration: 'none', + color: primaryColor + } +}) + +const SupportLinkButton = ({ link, label }) => { + const classes = useStyles() + return ( + + + {label} + + + ) +} + +export default SupportLinkButton diff --git a/new-lamassu-admin/src/components/buttons/index.js b/new-lamassu-admin/src/components/buttons/index.js index 2031fb58..5839f7fe 100644 --- a/new-lamassu-admin/src/components/buttons/index.js +++ b/new-lamassu-admin/src/components/buttons/index.js @@ -6,6 +6,7 @@ import IDButton from './IDButton' import IconButton from './IconButton' import Link from './Link' import SimpleButton from './SimpleButton' +import SupportLinkButton from './SupportLinkButton' export { Button, @@ -15,5 +16,6 @@ export { FeatureButton, IconButton, IDButton, - AddButton + AddButton, + SupportLinkButton } diff --git a/new-lamassu-admin/src/pages/Cashout/WizardStep.js b/new-lamassu-admin/src/pages/Cashout/WizardStep.js index 820c3e76..d36c411d 100644 --- a/new-lamassu-admin/src/pages/Cashout/WizardStep.js +++ b/new-lamassu-admin/src/pages/Cashout/WizardStep.js @@ -133,20 +133,20 @@ const WizardStep = ({ {lastStep && (
- Cashout Bill Count + Cash-out Bill Count

- When enabling cash out, your bill count will be automatically set to - zero. Make sure you physically put cash inside the cashboxes to + When enabling cash-out, your bill count will be automatically set to + zero. Make sure you physically put cash inside the cash cassettes to allow the machine to dispense it to your users. If you already did, - make sure you set the correct cash out bill count for this machine - on your Cashboxes tab under Maintenance. + make sure you set the correct cash-out bill count for this machine + on your Cash Cassettes tab under Maintenance.

Default Commissions

- When enabling cash out, default commissions will be set. To change + When enabling cash-out, default commissions will be set. To change commissions for this machine, please go to the Commissions tab under Settings where you can set exceptions for each of the available cryptocurrencies. diff --git a/new-lamassu-admin/src/pages/Maintenance/Cashboxes.js b/new-lamassu-admin/src/pages/Maintenance/CashCassettes.js similarity index 95% rename from new-lamassu-admin/src/pages/Maintenance/Cashboxes.js rename to new-lamassu-admin/src/pages/Maintenance/CashCassettes.js index d8c22235..9570a26f 100644 --- a/new-lamassu-admin/src/pages/Maintenance/Cashboxes.js +++ b/new-lamassu-admin/src/pages/Maintenance/CashCassettes.js @@ -10,7 +10,7 @@ import { NumberInput } from 'src/components/inputs/formik' import TitleSection from 'src/components/layout/TitleSection' import { fromNamespace } from 'src/utils/config' -import styles from './Cashboxes.styles.js' +import styles from './CashCassettes.styles.js' const useStyles = makeStyles(styles) @@ -60,7 +60,7 @@ const RESET_CASHOUT_BILLS = gql` } ` -const Cashboxes = () => { +const CashCassettes = () => { const classes = useStyles() const { data } = useQuery(GET_MACHINES_AND_CONFIG) @@ -136,7 +136,7 @@ const Cashboxes = () => { return ( <> - + { ) } -export default Cashboxes +export default CashCassettes diff --git a/new-lamassu-admin/src/pages/Maintenance/Cashboxes.styles.js b/new-lamassu-admin/src/pages/Maintenance/CashCassettes.styles.js similarity index 100% rename from new-lamassu-admin/src/pages/Maintenance/Cashboxes.styles.js rename to new-lamassu-admin/src/pages/Maintenance/CashCassettes.styles.js diff --git a/new-lamassu-admin/src/pages/OperatorInfo/ContactInfo.js b/new-lamassu-admin/src/pages/OperatorInfo/ContactInfo.js index d7ab6c63..e4ffec00 100644 --- a/new-lamassu-admin/src/pages/OperatorInfo/ContactInfo.js +++ b/new-lamassu-admin/src/pages/OperatorInfo/ContactInfo.js @@ -3,7 +3,6 @@ import { makeStyles } from '@material-ui/core' import classnames from 'classnames' import { Form, Formik, Field as FormikField } from 'formik' import gql from 'graphql-tag' -import { parsePhoneNumberFromString } from 'libphonenumber-js' import * as R from 'ramda' import React, { useState } from 'react' import * as Yup from 'yup' @@ -12,7 +11,7 @@ import ErrorMessage from 'src/components/ErrorMessage' import PromptWhenDirty from 'src/components/PromptWhenDirty' import { Link } from 'src/components/buttons' import Switch from 'src/components/inputs/base/Switch' -import { TextInput, NumberInput } from 'src/components/inputs/formik' +import { TextInput } from 'src/components/inputs/formik' import { P, H4, Info3, Label1, Label2, Label3 } from 'src/components/typography' import { ReactComponent as EditIcon } from 'src/styling/icons/action/edit/enabled.svg' import { ReactComponent as WarningIcon } from 'src/styling/icons/warning-icon/comet.svg' @@ -125,20 +124,13 @@ const ContactInfo = ({ wizard }) => { const info = data?.config && fromNamespace(namespaces.OPERATOR_INFO, data.config) - const locale = data?.config && fromNamespace(namespaces.LOCALE, data.config) if (!info) return null const validationSchema = Yup.object().shape({ active: Yup.boolean(), name: Yup.string(), - phone: Yup.string().test( - 'phone', - 'Please enter a valid phone number', - function(phone) { - return parsePhoneNumberFromString(phone, locale.country).isValid() - } - ), + phone: Yup.string(), email: Yup.string() .email('Please enter a valid email address') .required(), @@ -156,14 +148,8 @@ const ContactInfo = ({ wizard }) => { { name: 'phone', label: 'Phone number', - value: - info.phone && locale.country - ? parsePhoneNumberFromString( - info.phone, - locale.country - ).formatInternational() - : '', - component: NumberInput + value: info.phone, + component: TextInput }, { name: 'email', diff --git a/new-lamassu-admin/src/pages/OperatorInfo/ReceiptPrinting/ReceiptPrinting.js b/new-lamassu-admin/src/pages/OperatorInfo/ReceiptPrinting/ReceiptPrinting.js index 4bd94446..d98d42d0 100644 --- a/new-lamassu-admin/src/pages/OperatorInfo/ReceiptPrinting/ReceiptPrinting.js +++ b/new-lamassu-admin/src/pages/OperatorInfo/ReceiptPrinting/ReceiptPrinting.js @@ -49,7 +49,7 @@ const ReceiptPrinting = memo(({ wizard }) => {

Receipt options

-

Share information?

+

Enable receipt printing?

{
{ const fiat = Number.parseFloat(tx.fiat) const crypto = toUnit(new BigNumber(tx.cryptoAtoms), tx.cryptoCode) const commissionPercentage = Number.parseFloat(tx.commissionPercentage, 2) - const commission = fiat * commissionPercentage + const commission = Number(fiat * commissionPercentage).toFixed(2) const exchangeRate = Number(fiat / crypto).toFixed(3) const displayExRate = `1 ${tx.cryptoCode} = ${exchangeRate} ${tx.fiatCode}` diff --git a/new-lamassu-admin/src/pages/Triggers/Triggers.js b/new-lamassu-admin/src/pages/Triggers/Triggers.js index 1ebc8fcb..d53853b8 100644 --- a/new-lamassu-admin/src/pages/Triggers/Triggers.js +++ b/new-lamassu-admin/src/pages/Triggers/Triggers.js @@ -95,9 +95,9 @@ const Triggers = () => {

- The "Reject reused addresses" option means that all addresses - that are used once will be automatically rejected if there's an - attempt to use them again on a new transaction. + This option requires a user to scan a different cryptocurrency + address if they attempt to scan one that had been previously + used for a transaction in your network

diff --git a/new-lamassu-admin/src/pages/Wizard/components/Twilio.js b/new-lamassu-admin/src/pages/Wizard/components/Twilio.js index b83ed4f1..bde64e5c 100644 --- a/new-lamassu-admin/src/pages/Wizard/components/Twilio.js +++ b/new-lamassu-admin/src/pages/Wizard/components/Twilio.js @@ -6,7 +6,7 @@ import React, { useState } from 'react' import InfoMessage from 'src/components/InfoMessage' import Tooltip from 'src/components/Tooltip' -import { Button } from 'src/components/buttons' +import { Button, SupportLinkButton } from 'src/components/buttons' import { RadioGroup } from 'src/components/inputs' import { H1, H4, P } from 'src/components/typography' import FormRenderer from 'src/pages/Services/FormRenderer' @@ -109,7 +109,7 @@ function Twilio({ doContinue }) {

You’ll need an SMS service for cash-out transactions and for any - complaince triggers + compliance triggers

@@ -123,9 +123,12 @@ function Twilio({ doContinue }) { /> - Before configuring Twilio, create an account and phone number to use - the Admin. + To set up Twilio please read the instructions from our support portal. + {selected === 'enable' && ( <> diff --git a/new-lamassu-admin/src/pages/Wizard/components/Wallet/AllSet.js b/new-lamassu-admin/src/pages/Wizard/components/Wallet/AllSet.js index aff15d09..489ace16 100644 --- a/new-lamassu-admin/src/pages/Wizard/components/Wallet/AllSet.js +++ b/new-lamassu-admin/src/pages/Wizard/components/Wallet/AllSet.js @@ -65,7 +65,7 @@ const AllSet = ({ data: currentData, doContinue }) => { <>

All set

- This are your wallet settings. You can later edit these and add + These are your wallet settings. You can later edit these and add additional coins.

{ <>

Blockcypher

- If you are enabling cash-out services,{' '} - - - create a Blockcypher account. - - + If you are enabling cash-out services, create a Blockcypher account.

+ {
- Make sure you set up {selected} to enter the necessary information - below. Please follow the instructions on our support page if you - haven’t. + Make sure you set up {schema[selected].name} to enter the + necessary information below. Please follow the instructions on our + support page if you haven’t.
- - - {selected} trading - - +

Enter exchange information

{ our support portal.
- - - Support article - - + )} {!isConfigurable(selected) && ( @@ -133,19 +122,10 @@ const ChooseWallet = ({ data: currentData, addData }) => { page if you haven’t. - - - Support article - - +

Enter wallet information