+
{error && Failed to save}
{createErrorMessage(errors, touched, values) && (
{createErrorMessage(errors, touched, values)}
)}
-
diff --git a/new-lamassu-admin/src/pages/Triggers/helper.jsx b/new-lamassu-admin/src/pages/Triggers/helper.jsx
index cd8a18c8..b6d82200 100644
--- a/new-lamassu-admin/src/pages/Triggers/helper.jsx
+++ b/new-lamassu-admin/src/pages/Triggers/helper.jsx
@@ -1,4 +1,3 @@
-import { makeStyles } from '@mui/styles'
import classnames from 'classnames'
import { Field, useFormikContext } from 'formik'
import * as R from 'ramda'
@@ -7,95 +6,9 @@ import { H4, Label2, Label1, Info1, Info2 } from 'src/components/typography'
import * as Yup from 'yup'
import { NumberInput, RadioGroup, Dropdown } from 'src/components/inputs/formik'
-import { errorColor } from 'src/styling/variables'
import { transformNumber } from 'src/utils/number'
import { onlyFirstToUpper } from 'src/utils/string'
-// import TxInIcon from 'src/styling/icons/direction/cash-in.svg?react'
-// import TxOutIcon from 'src/styling/icons/direction/cash-out.svg?react'
-
-const useStyles = makeStyles({
- radioLabel: {
- height: 40,
- padding: [[0, 10]]
- },
- radio: {
- padding: 4,
- margin: 4
- },
- radioGroup: {
- flexDirection: 'row'
- },
- error: {
- color: errorColor
- },
- specialLabel: {
- height: 40,
- padding: 0
- },
- specialGrid: {
- display: 'grid',
- gridTemplateColumns: [[182, 162, 181]]
- },
- directionIcon: {
- marginRight: 2
- },
- directionName: {
- marginLeft: 6
- },
- thresholdWrapper: {
- display: 'flex',
- flexDirection: 'column'
- },
- thresholdTitle: {
- marginTop: 50
- },
- thresholdContentWrapper: {
- display: 'flex',
- flexDirection: 'row'
- },
- thresholdField: {
- marginRight: 6,
- width: 75
- },
- description: {
- marginTop: 7
- },
- space: {
- marginLeft: 6,
- marginRight: 6
- },
- lastSpace: {
- marginLeft: 6
- },
- suspensionDays: {
- width: 34
- },
- input: {
- marginTop: -2
- },
- limitedInput: {
- width: 50
- },
- daysInput: {
- width: 60
- },
- dropdownField: {
- marginTop: 16,
- minWidth: 155
- },
- externalFields: {
- '& > *': {
- marginRight: 15
- },
- '& > *:last-child': {
- marginRight: 0
- }
- }
-})
-
-// const direction = Yup.string().required()
-
const triggerType = Yup.string().required()
const threshold = Yup.object().shape({
threshold: Yup.number()
@@ -171,92 +84,6 @@ const Schema = Yup.object()
})
})
-// Direction V2 only
-// const directionSchema = Yup.object().shape({ direction })
-
-// const directionOptions = [
-// {
-// display: 'Both',
-// code: 'both'
-// },
-// {
-// display: 'Only cash-in',
-// code: 'cashIn'
-// },
-// {
-// display: 'Only cash-out',
-// code: 'cashOut'
-// }
-// ]
-
-// const directionOptions2 = [
-// {
-// display: (
-// <>
-//
in
-// >
-// ),
-// code: 'cashIn'
-// },
-// {
-// display: (
-// <>
-//
out
-// >
-// ),
-// code: 'cashOut'
-// },
-// {
-// display: (
-// <>
-//
-//
-//
-//
-//
-//
-//
-//
-// >
-// ),
-// code: 'both'
-// }
-// ]
-
-// const Direction = () => {
-// const classes = useStyles()
-// const { errors } = useFormikContext()
-
-// const titleClass = {
-// [classes.error]: errors.direction
-// }
-
-// return (
-// <>
-//
-//
-// In which type of transactions will it trigger?
-//
-//
-//
-// >
-// )
-// }
-
-// const txDirection = {
-// schema: directionSchema,
-// options: directionOptions,
-// Component: Direction,
-// initialValues: { direction: '' }
-// }
-
// TYPE
const typeSchema = Yup.object()
.shape({
@@ -314,18 +141,20 @@ const typeSchema = Yup.object()
const typeOptions = [
{ display: 'Transaction amount', code: 'txAmount' },
- { display: 'Transaction volume', code: 'txVolume' },
+ {
+ display: 'Transaction volume',
+ code: 'txVolume'
+ },
{ display: 'Transaction velocity', code: 'txVelocity' },
{ display: 'Consecutive days', code: 'consecutiveDays' }
]
const Type = ({ ...props }) => {
- const classes = useStyles()
const { errors, touched, values, setTouched, handleChange } =
useFormikContext()
const typeClass = {
- [classes.error]: errors.triggerType && touched.triggerType
+ 'text-tomato': errors.triggerType && touched.triggerType
}
const containsType = R.contains(values?.triggerType)
@@ -348,7 +177,7 @@ const Type = ({ ...props }) => {
const triggerTypeError = !!(hasDaysError || hasAmountError)
const thresholdClass = {
- [classes.error]: triggerTypeError
+ 'text-tomato': triggerTypeError
}
const isRadioGroupActive = () => {
@@ -369,9 +198,9 @@ const Type = ({ ...props }) => {
component={RadioGroup}
name="triggerType"
options={typeOptions}
- labelClassName={classes.radioLabel}
- radioClassName={classes.radio}
- className={classes.radioGroup}
+ labelClassName="h-10 py-0 px-3"
+ radioClassName="p-1 m-1"
+ className="flex-row"
onChange={e => {
handleChange(e)
setTouched({
@@ -381,73 +210,58 @@ const Type = ({ ...props }) => {
}}
/>
-
+
{isRadioGroupActive() && (
-
- Threshold
-
+
Threshold
)}
-
+
{isThresholdCurrencyEnabled && (
<>
-
- {props.currency}
-
+ {props.currency}
>
)}
{isTransactionAmountEnabled && (
<>
-
- transactions
-
+ transactions
>
)}
{isThresholdDaysEnabled && (
<>
-
- in
-
+ in
- days
+ days
>
)}
{isConsecutiveDaysEnabled && (
<>
-
- consecutive days
-
+ consecutive days
>
)}
@@ -527,16 +341,27 @@ const requirementSchema = Yup.object()
const requirementOptions = [
{ display: 'SMS verification', code: 'sms' },
- { display: 'Email verification', code: 'email' },
+ {
+ display: 'Email verification',
+ code: 'email'
+ },
{ display: 'ID card image', code: 'idCardPhoto' },
- { display: 'ID data', code: 'idCardData' },
+ {
+ display: 'ID data',
+ code: 'idCardData'
+ },
{ display: 'Customer camera', code: 'facephoto' },
{ display: 'Sanctions', code: 'sanctions' },
- { display: 'US SSN', code: 'usSsn' },
- // { display: 'Super user', code: 'superuser' },
+ {
+ display: 'US SSN',
+ code: 'usSsn'
+ }, // { display: 'Super user', code: 'superuser' },
{ display: 'Suspend', code: 'suspend' },
{ display: 'Block', code: 'block' },
- { display: 'External verification', code: 'external' }
+ {
+ display: 'External verification',
+ code: 'external'
+ }
]
const hasRequirementError = (errors, touched, values) =>
@@ -563,7 +388,6 @@ const Requirement = ({
complianceServices,
customInfoRequests = []
}) => {
- const classes = useStyles()
const { touched, errors, values, handleChange, setTouched } =
useFormikContext()
@@ -587,7 +411,10 @@ const Requirement = ({
const availableCustomRequirements = R.filter(
it =>
!R.includes(
- { triggerType: config.triggerType, id: it.id },
+ {
+ triggerType: config.triggerType,
+ id: it.id
+ },
customRequirementsInUse
),
customInfoRequests
@@ -613,7 +440,7 @@ const Requirement = ({
enableCustomRequirement && options.push(customInfoOption)
const titleClass = {
- [classes.error]:
+ 'text-tomato':
(!!errors.requirement && !isSuspend && !isCustom && !isExternal) ||
(isSuspend && hasRequirementError(errors, touched, values)) ||
(isCustom && hasCustomRequirementError(errors, touched, values)) ||
@@ -629,9 +456,9 @@ const Requirement = ({
component={RadioGroup}
name="requirement.requirement"
options={options}
- labelClassName={classes.specialLabel}
- radioClassName={classes.radio}
- className={classnames(classes.radioGroup, classes.specialGrid)}
+ labelClassName="h-10 p-0"
+ radioClassName="p-1 m-1"
+ className="flex-row grid grid-cols-[182px_162px_181px]"
onChange={e => {
handleChange(e)
setTouched({
@@ -641,7 +468,7 @@ const Requirement = ({
/>
{isSuspend && (
)}
{isExternal && (
-
+
it => {
return R.compose(R.prop(code), R.find(R.propEq(compare ?? 'code', it)))(data)
}
-// const DirectionDisplay = ({ code }) => {
-// const classes = useStyles()
-// const displayName = getView(directionOptions, 'display')(code)
-// const showCashIn = code === 'cashIn' || code === 'both'
-// const showCashOut = code === 'cashOut' || code === 'both'
-
-// return (
-//
-// {showCashOut && }
-// {showCashIn && }
-// {displayName}
-//
-// )
-// }
-
const customReqIdMatches = customReqId => it => {
return it.id === customReqId
}
const RequirementInput = ({ customInfoRequests = [] }) => {
const { values } = useFormikContext()
- const classes = useStyles()
-
const requirement = values?.requirement?.requirement
const customRequestId =
R.path(['requirement', 'customInfoRequestId'])(values) ?? ''
@@ -753,7 +563,7 @@ const RequirementInput = ({ customInfoRequests = [] }) => {
{isSuspend && (
{
- const classes = useStyles()
const display =
requirement === 'custom'
? (R.path(['customRequest', 'name'])(
@@ -785,7 +594,7 @@ const RequirementView = ({
{`${display} ${isSuspend ? 'for' : ''}`}
{isSuspend && (
-
+
{suspensionDays}
)}
@@ -795,12 +604,10 @@ const RequirementView = ({
}
const DisplayThreshold = ({ config, currency, isEdit }) => {
- const classes = useStyles()
-
const inputClasses = {
- [classes.input]: true,
- [classes.limitedInput]: config?.triggerType === 'txVelocity',
- [classes.daysInput]: config?.triggerType === 'consecutiveDays'
+ '-mt-1': true,
+ 'w-13': config?.triggerType === 'txVelocity',
+ 'w-15': config?.triggerType === 'consecutiveDays'
}
const threshold = config?.threshold?.threshold
@@ -834,7 +641,7 @@ const DisplayThreshold = ({ config, currency, isEdit }) => {
return (
{Threshold}
-
+
{currency}
@@ -843,14 +650,14 @@ const DisplayThreshold = ({ config, currency, isEdit }) => {
return (
{Threshold}
-
+
{currency}
-
+
in
{ThresholdDays}
-
+
days
@@ -859,11 +666,11 @@ const DisplayThreshold = ({ config, currency, isEdit }) => {
return (
{Threshold}
-
+
transactions in
{ThresholdDays}
-
+
days
@@ -872,7 +679,7 @@ const DisplayThreshold = ({ config, currency, isEdit }) => {
return (
{ThresholdDays}
-
+
days
@@ -892,7 +699,7 @@ const ThresholdView = ({ config, currency }) => {
return
}
-const getElements = (currency, classes, customInfoRequests) => [
+const getElements = (currency, customInfoRequests) => [
{
name: 'triggerType',
size: 'sm',
@@ -926,18 +733,6 @@ const getElements = (currency, classes, customInfoRequests) => [
input: () => ,
view: (it, config) =>
}
- // {
- // name: 'direction',
- // size: 'sm',
- // width: 282,
- // view: it => ,
- // input: RadioGroup,
- // inputProps: {
- // labelClassName: classes.tableRadioLabel,
- // className: classes.tableRadioGroup,
- // options: directionOptions2
- // }
- // }
]
const triggerOrder = R.map(R.prop('code'))(typeOptions)
@@ -987,8 +782,7 @@ const toServer = triggers =>
export {
Schema,
- getElements,
- // txDirection,
+ getElements, // txDirection,
type,
requirements,
sortBy,
diff --git a/new-lamassu-admin/src/pages/UserManagement/modals/CreateUserModal.jsx b/new-lamassu-admin/src/pages/UserManagement/modals/CreateUserModal.jsx
index e6048622..8b4213d1 100644
--- a/new-lamassu-admin/src/pages/UserManagement/modals/CreateUserModal.jsx
+++ b/new-lamassu-admin/src/pages/UserManagement/modals/CreateUserModal.jsx
@@ -6,7 +6,7 @@ import React, { useState } from 'react'
import ErrorMessage from 'src/components/ErrorMessage'
import Modal from 'src/components/Modal'
import { H1, H3, Info2, P, Mono } from 'src/components/typography'
-import CopyToClipboard from 'src/pages/Transactions/CopyToClipboard'
+import CopyToClipboard from 'src/components/CopyToClipboard.jsx'
import * as Yup from 'yup'
import { Button } from 'src/components/buttons'
diff --git a/new-lamassu-admin/src/pages/UserManagement/modals/Reset2FAModal.jsx b/new-lamassu-admin/src/pages/UserManagement/modals/Reset2FAModal.jsx
index ae1cfc49..b91f8f54 100644
--- a/new-lamassu-admin/src/pages/UserManagement/modals/Reset2FAModal.jsx
+++ b/new-lamassu-admin/src/pages/UserManagement/modals/Reset2FAModal.jsx
@@ -1,10 +1,10 @@
-import { useMutation, gql } from "@apollo/client";
+import { useMutation, gql } from '@apollo/client'
import { makeStyles } from '@mui/styles'
import React, { useEffect, useState } from 'react'
import ErrorMessage from 'src/components/ErrorMessage'
import Modal from 'src/components/Modal'
import { Info2, P, Mono } from 'src/components/typography'
-import CopyToClipboard from 'src/pages/Transactions/CopyToClipboard'
+import CopyToClipboard from 'src/components/CopyToClipboard.jsx'
import { urlResolver } from 'src/utils/urlResolver'
diff --git a/new-lamassu-admin/src/pages/UserManagement/modals/ResetPasswordModal.jsx b/new-lamassu-admin/src/pages/UserManagement/modals/ResetPasswordModal.jsx
index ca53e015..d6b36f7e 100644
--- a/new-lamassu-admin/src/pages/UserManagement/modals/ResetPasswordModal.jsx
+++ b/new-lamassu-admin/src/pages/UserManagement/modals/ResetPasswordModal.jsx
@@ -1,10 +1,10 @@
-import { useMutation, gql } from "@apollo/client";
+import { useMutation, gql } from '@apollo/client'
import { makeStyles } from '@mui/styles'
import React, { useEffect, useState } from 'react'
import ErrorMessage from 'src/components/ErrorMessage'
import Modal from 'src/components/Modal'
import { Info2, P, Mono } from 'src/components/typography'
-import CopyToClipboard from 'src/pages/Transactions/CopyToClipboard'
+import CopyToClipboard from 'src/components/CopyToClipboard.jsx'
import { urlResolver } from 'src/utils/urlResolver'