chore: prettier config

husky needs to be delegated to v11 since it breaks with node 14 + 22
combo
This commit is contained in:
Rafael 2024-12-03 09:33:06 +00:00
parent dbca0c8a8c
commit d3c3de66fe
65 changed files with 1542 additions and 22553 deletions

View file

@ -0,0 +1,8 @@
{
"trailingComma": "none",
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"arrowParens": "avoid",
"bracketSameLine": true
}

View file

@ -2,6 +2,7 @@ import globals from 'globals'
import pluginJs from '@eslint/js' import pluginJs from '@eslint/js'
import pluginReact from 'eslint-plugin-react' import pluginReact from 'eslint-plugin-react'
import reactCompiler from 'eslint-plugin-react-compiler' import reactCompiler from 'eslint-plugin-react-compiler'
import eslintConfigPrettier from 'eslint-config-prettier'
/** @type {import('eslint').Linter.Config[]} */ /** @type {import('eslint').Linter.Config[]} */
export default [ export default [
@ -17,7 +18,7 @@ export default [
settings: { settings: {
react: { react: {
version: '16' version: '16'
}, }
}, },
plugins: { plugins: {
'react-compiler': reactCompiler 'react-compiler': reactCompiler
@ -31,7 +32,8 @@ export default [
'react/prop-types': 'off', 'react/prop-types': 'off',
'react/display-name': 'off', 'react/display-name': 'off',
'react/no-unescaped-entities': 'off', 'react/no-unescaped-entities': 'off',
'react-compiler/react-compiler': 'warn', 'react-compiler/react-compiler': 'warn'
}
} }
},
eslintConfigPrettier
] ]

File diff suppressed because it is too large Load diff

View file

@ -56,26 +56,19 @@
"@vitejs/plugin-react-swc": "^3.7.2", "@vitejs/plugin-react-swc": "^3.7.2",
"esbuild-plugin-react-virtualized": "^1.0.4", "esbuild-plugin-react-virtualized": "^1.0.4",
"eslint": "^9.16.0", "eslint": "^9.16.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-react": "^7.37.2", "eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-compiler": "^19.0.0-beta-df7b47d-20241124", "eslint-plugin-react-compiler": "^19.0.0-beta-df7b47d-20241124",
"globals": "^15.13.0", "globals": "^15.13.0",
"husky": "^3.1.0", "lint-staged": "^15.2.10",
"lint-staged": "^9.5.0", "prettier": "3.4.1",
"react-scripts": "4.0.0",
"vite": "^6.0.1", "vite": "^6.0.1",
"vite-plugin-svgr": "^4.3.0" "vite-plugin-svgr": "^4.3.0"
}, },
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": [
"eslint --fix",
"git add"
]
},
"scripts": { "scripts": {
"start": "vite", "start": "vite",
"build": "vite build", "build": "vite build",
"preview": "vite preview", "preview": "vite preview"
"fix": "eslint --fix --ext .js,.md,.json src/"
}, },
"browserslist": { "browserslist": {
"production": [ "production": [
@ -88,5 +81,9 @@
"last 1 firefox version", "last 1 firefox version",
"last 1 safari version" "last 1 safari version"
] ]
},
"lint-staged": {
"*.{js,jsx,md,json}": "eslint --cache --fix",
"*.{js,jsx,css,md,json}": "prettier --write"
} }
} }

View file

@ -115,12 +115,7 @@ const Main = () => {
)} )}
<main className={classes.wrapper}> <main className={classes.wrapper}>
{sidebar && !is404 && wizardTested && ( {sidebar && !is404 && wizardTested && (
<Slide <Slide direction="left" in={true} mountOnEnter unmountOnExit>
direction="left"
in={true}
mountOnEnter
unmountOnExit
>
<div> <div>
<TitleSection title={parent.title}></TitleSection> <TitleSection title={parent.title}></TitleSection>
</div> </div>

View file

@ -6,7 +6,8 @@ import { styles } from './TextInput.styles'
const useStyles = makeStyles(styles) const useStyles = makeStyles(styles)
const mask = /(\+)(9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)(\d{1,3}){0,1}(\d{1,3}){0,1}(\d{1,3}){0,1}(\d{1,3}){0,1}(\d{1,2}){0,1}$/ const mask =
/(\+)(9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)(\d{1,3}){0,1}(\d{1,3}){0,1}(\d{1,3}){0,1}(\d{1,3}){0,1}(\d{1,2}){0,1}$/
const maskValue = value => const maskValue = value =>
value ? value.replace(mask, '$1 $2 $3 $4 $5 $6') : '' value ? value.replace(mask, '$1 $2 $3 $4 $5 $6') : ''

View file

@ -141,7 +141,9 @@ const Header = memo(({ tree, user }) => {
className={classnames(classes.link, classes.whiteLink)} className={classnames(classes.link, classes.whiteLink)}
activeClassName={classes.activeLink}> activeClassName={classes.activeLink}>
<li className={classes.li}> <li className={classes.li}>
<span className={classes.forceSize} data-forcesize={it.label}> <span
className={classes.forceSize}
data-forcesize={it.label}>
{it.label} {it.label}
</span> </span>
</li> </li>

View file

@ -26,7 +26,10 @@ const Sidebar = ({
{loading && <P>Loading...</P>} {loading && <P>Loading...</P>}
{!loading && {!loading &&
data?.map((it, idx) => ( data?.map((it, idx) => (
<div key={idx} className={classes.linkWrapper} onClick={() => onClick(it)}> <div
key={idx}
className={classes.linkWrapper}
onClick={() => onClick(it)}>
<div <div
key={idx} key={idx}
className={classnames({ className={classnames({

View file

@ -50,7 +50,6 @@ const Graph = ({
const step = R.clone(start) const step = R.clone(start)
while (step <= end) { while (step <= end) {
ticks.push(R.clone(step)) ticks.push(R.clone(step))
step.setUTCHours(step.getUTCHours() + interval) step.setUTCHours(step.getUTCHours() + interval)
@ -105,19 +104,25 @@ const Graph = ({
]) ])
.rangeRound([GRAPH_MARGIN.left, GRAPH_WIDTH - GRAPH_MARGIN.right]) .rangeRound([GRAPH_MARGIN.left, GRAPH_WIDTH - GRAPH_MARGIN.right])
const groupedByDateInterval = R.map(it => { const groupedByDateInterval = R.map(
it => {
const lowerBound = R.clone(it) const lowerBound = R.clone(it)
it.setUTCHours(it.getUTCHours() + 2) it.setUTCHours(it.getUTCHours() + 2)
const upperBound = R.clone(it) const upperBound = R.clone(it)
return [lowerBound, filterByHourInterval(lowerBound, upperBound)] return [lowerBound, filterByHourInterval(lowerBound, upperBound)]
}, R.init(getTickIntervals(x.domain(), 2))) },
R.init(getTickIntervals(x.domain(), 2))
)
const groupedByTxClass = R.map(it => { const groupedByTxClass = R.map(
it => {
const lowerBound = R.clone(it) const lowerBound = R.clone(it)
it.setUTCHours(it.getUTCHours() + 2) it.setUTCHours(it.getUTCHours() + 2)
const upperBound = R.clone(it) const upperBound = R.clone(it)
return [lowerBound, txClassByHourInterval(lowerBound, upperBound)] return [lowerBound, txClassByHourInterval(lowerBound, upperBound)]
}, R.init(getTickIntervals(x.domain(), 2))) },
R.init(getTickIntervals(x.domain(), 2))
)
const y = d3 const y = d3
.scaleLinear() .scaleLinear()
@ -416,9 +421,7 @@ const Graph = ({
]) ])
useEffect(() => { useEffect(() => {
d3.select(ref.current) d3.select(ref.current).selectAll('*').remove()
.selectAll('*')
.remove()
drawChart() drawChart()
}, [drawChart]) }, [drawChart])

View file

@ -404,10 +404,7 @@ const Graph = ({
) )
// Left side breakpoint label // Left side breakpoint label
.call(g => { .call(g => {
const separator = d3 const separator = d3?.select('.dateSeparator')?.node()?.getBBox()
?.select('.dateSeparator')
?.node()
?.getBBox()
if (!separator) return if (!separator) return
@ -428,10 +425,7 @@ const Graph = ({
}) })
// Right side breakpoint label // Right side breakpoint label
.call(g => { .call(g => {
const separator = d3 const separator = d3?.select('.dateSeparator')?.node()?.getBBox()
?.select('.dateSeparator')
?.node()
?.getBBox()
if (!separator) return if (!separator) return
@ -560,9 +554,7 @@ const Graph = ({
]) ])
useEffect(() => { useEffect(() => {
d3.select(ref.current) d3.select(ref.current).selectAll('*').remove()
.selectAll('*')
.remove()
drawChart() drawChart()
}, [drawChart]) }, [drawChart])

View file

@ -455,10 +455,7 @@ const Graph = ({
) )
// Left side breakpoint label // Left side breakpoint label
.call(g => { .call(g => {
const separator = d3 const separator = d3?.select('.dateSeparator')?.node()?.getBBox()
?.select('.dateSeparator')
?.node()
?.getBBox()
if (!separator) return if (!separator) return
@ -479,10 +476,7 @@ const Graph = ({
}) })
// Right side breakpoint label // Right side breakpoint label
.call(g => { .call(g => {
const separator = d3 const separator = d3?.select('.dateSeparator')?.node()?.getBBox()
?.select('.dateSeparator')
?.node()
?.getBBox()
if (!separator) return if (!separator) return
@ -636,9 +630,7 @@ const Graph = ({
]) ])
useEffect(() => { useEffect(() => {
d3.select(ref.current) d3.select(ref.current).selectAll('*').remove()
.selectAll('*')
.remove()
drawChart() drawChart()
}, [drawChart]) }, [drawChart])

View file

@ -36,10 +36,13 @@ const Graph = ({ data, machines, currency, selectedMachine }) => {
const filledMachines = const filledMachines =
R.length(machines) >= AMOUNT_OF_MACHINES R.length(machines) >= AMOUNT_OF_MACHINES
? machinesClone ? machinesClone
: R.map(it => { : R.map(
it => {
if (!R.isNil(machinesClone[it])) return machinesClone[it] if (!R.isNil(machinesClone[it])) return machinesClone[it]
return { code: `ghostMachine${it}`, display: `` } return { code: `ghostMachine${it}`, display: `` }
}, R.times(R.identity, AMOUNT_OF_MACHINES)) },
R.times(R.identity, AMOUNT_OF_MACHINES)
)
const txByDevice = R.reduce( const txByDevice = R.reduce(
(acc, value) => { (acc, value) => {
@ -108,8 +111,9 @@ const Graph = ({ data, machines, currency, selectedMachine }) => {
.axisBottom(x) .axisBottom(x)
.tickFormat( .tickFormat(
d => d =>
`${R.find(it => it.code === d[0], filledMachines).display ?? `${
''}` R.find(it => it.code === d[0], filledMachines).display ?? ''
}`
) )
.tickSize(0) .tickSize(0)
.tickPadding(10) .tickPadding(10)
@ -295,9 +299,7 @@ const Graph = ({ data, machines, currency, selectedMachine }) => {
]) ])
useEffect(() => { useEffect(() => {
d3.select(ref.current) d3.select(ref.current).selectAll('*').remove()
.selectAll('*')
.remove()
drawChart() drawChart()
}, [drawChart]) }, [drawChart])

View file

@ -48,10 +48,7 @@ const GET_USER_DATA = gql`
` `
const validationSchema = Yup.object().shape({ const validationSchema = Yup.object().shape({
email: Yup.string() email: Yup.string().label('Email').required().email(),
.label('Email')
.required()
.email(),
password: Yup.string().required('Password field is required'), password: Yup.string().required('Password field is required'),
rememberMe: Yup.boolean() rememberMe: Yup.boolean()
}) })

View file

@ -109,9 +109,7 @@ const BlacklistAdvanced = ({
const validationSchema = Yup.object().shape({ const validationSchema = Yup.object().shape({
label: Yup.string().required('A label is required!'), label: Yup.string().required('A label is required!'),
content: Yup.string() content: Yup.string().required('The message content is required!').trim()
.required('The message content is required!')
.trim()
}) })
return ( return (

View file

@ -36,9 +36,7 @@ const BlackListModal = ({ onClose, addToBlacklist, errorMsg }) => {
address: '' address: ''
}} }}
validationSchema={Yup.object({ validationSchema={Yup.object({
address: Yup.string() address: Yup.string().trim().required('An address is required')
.trim()
.required('An address is required')
})} })}
onSubmit={({ address }) => { onSubmit={({ address }) => {
handleAddToBlacklist(address.trim()) handleAddToBlacklist(address.trim())

View file

@ -83,63 +83,43 @@ const Wizard = ({ machine, locale, onClose, save, error }) => {
cassette1: cassette1:
machine.numberOfCassettes >= 1 && step >= 1 machine.numberOfCassettes >= 1 && step >= 1
? Yup.number().required() ? Yup.number().required()
: Yup.number() : Yup.number().transform(transformNumber).nullable(),
.transform(transformNumber)
.nullable(),
cassette2: cassette2:
machine.numberOfCassettes >= 2 && step >= 2 machine.numberOfCassettes >= 2 && step >= 2
? Yup.number().required() ? Yup.number().required()
: Yup.number() : Yup.number().transform(transformNumber).nullable(),
.transform(transformNumber)
.nullable(),
cassette3: cassette3:
machine.numberOfCassettes >= 3 && step >= 3 machine.numberOfCassettes >= 3 && step >= 3
? Yup.number().required() ? Yup.number().required()
: Yup.number() : Yup.number().transform(transformNumber).nullable(),
.transform(transformNumber)
.nullable(),
cassette4: cassette4:
machine.numberOfCassettes >= 4 && step >= 4 machine.numberOfCassettes >= 4 && step >= 4
? Yup.number().required() ? Yup.number().required()
: Yup.number() : Yup.number().transform(transformNumber).nullable(),
.transform(transformNumber)
.nullable(),
recycler1: recycler1:
machine.numberOfRecyclers >= 1 && step >= machine.numberOfCassettes + 1 machine.numberOfRecyclers >= 1 && step >= machine.numberOfCassettes + 1
? Yup.number().required() ? Yup.number().required()
: Yup.number() : Yup.number().transform(transformNumber).nullable(),
.transform(transformNumber)
.nullable(),
recycler2: recycler2:
machine.numberOfRecyclers >= 2 && step >= machine.numberOfCassettes + 2 machine.numberOfRecyclers >= 2 && step >= machine.numberOfCassettes + 2
? Yup.number().required() ? Yup.number().required()
: Yup.number() : Yup.number().transform(transformNumber).nullable(),
.transform(transformNumber)
.nullable(),
recycler3: recycler3:
machine.numberOfRecyclers >= 3 && step >= machine.numberOfCassettes + 3 machine.numberOfRecyclers >= 3 && step >= machine.numberOfCassettes + 3
? Yup.number().required() ? Yup.number().required()
: Yup.number() : Yup.number().transform(transformNumber).nullable(),
.transform(transformNumber)
.nullable(),
recycler4: recycler4:
machine.numberOfRecyclers >= 4 && step >= machine.numberOfCassettes + 4 machine.numberOfRecyclers >= 4 && step >= machine.numberOfCassettes + 4
? Yup.number().required() ? Yup.number().required()
: Yup.number() : Yup.number().transform(transformNumber).nullable(),
.transform(transformNumber)
.nullable(),
recycler5: recycler5:
machine.numberOfRecyclers >= 5 && step >= machine.numberOfCassettes + 5 machine.numberOfRecyclers >= 5 && step >= machine.numberOfCassettes + 5
? Yup.number().required() ? Yup.number().required()
: Yup.number() : Yup.number().transform(transformNumber).nullable(),
.transform(transformNumber)
.nullable(),
recycler6: recycler6:
machine.numberOfRecyclers >= 6 && step >= machine.numberOfCassettes + 6 machine.numberOfRecyclers >= 6 && step >= machine.numberOfCassettes + 6
? Yup.number().required() ? Yup.number().required()
: Yup.number() : Yup.number().transform(transformNumber).nullable()
.transform(transformNumber)
.nullable()
}) })
return ( return (

View file

@ -325,10 +325,7 @@ const getOverridesSchema = (values, rawData, locale) => {
const highestBill = R.isEmpty(bills) ? CURRENCY_MAX : Math.max(...bills) const highestBill = R.isEmpty(bills) ? CURRENCY_MAX : Math.max(...bills)
return Yup.object().shape({ return Yup.object().shape({
machine: Yup.string() machine: Yup.string().nullable().label('Machine').required(),
.nullable()
.label('Machine')
.required(),
cryptoCurrencies: Yup.array() cryptoCurrencies: Yup.array()
.test({ .test({
test() { test() {
@ -474,13 +471,8 @@ const getListCommissionsSchema = locale => {
const highestBill = R.isEmpty(bills) ? CURRENCY_MAX : Math.max(...bills) const highestBill = R.isEmpty(bills) ? CURRENCY_MAX : Math.max(...bills)
return Yup.object().shape({ return Yup.object().shape({
machine: Yup.string() machine: Yup.string().label('Machine').required(),
.label('Machine') cryptoCurrencies: Yup.array().label('Crypto currency').required().min(1),
.required(),
cryptoCurrencies: Yup.array()
.label('Crypto currency')
.required()
.min(1),
cashIn: Yup.number() cashIn: Yup.number()
.label('Cash-in') .label('Cash-in')
.min(percentMin) .min(percentMin)

View file

@ -263,9 +263,7 @@ const CustomerData = ({
src={ src={
!R.isNil(previewPhoto) !R.isNil(previewPhoto)
? URL.createObjectURL(previewPhoto) ? URL.createObjectURL(previewPhoto)
: `/front-camera-photo/${R.path(['frontCameraPath'])( : `/front-camera-photo/${R.path(['frontCameraPath'])(customer)}`
customer
)}`
} }
/> />
) : null ) : null
@ -304,9 +302,7 @@ const CustomerData = ({
src={ src={
!R.isNil(previewCard) !R.isNil(previewCard)
? URL.createObjectURL(previewCard) ? URL.createObjectURL(previewCard)
: `/id-card-photo/${R.path(['idCardPhotoPath'])( : `/id-card-photo/${R.path(['idCardPhotoPath'])(customer)}`
customer
)}`
} }
/> />
) : null ) : null
@ -386,7 +382,8 @@ const CustomerData = ({
}) })
}, customInfoRequests) }, customInfoRequests)
R.forEach(it => { R.forEach(
it => {
customFields.push({ customFields.push({
fields: [ fields: [
{ {
@ -413,9 +410,12 @@ const CustomerData = ({
[it.label]: it.value ?? '' [it.label]: it.value ?? ''
} }
}) })
}, R.path(['customFields'])(customer) ?? []) },
R.path(['customFields'])(customer) ?? []
)
R.forEach(it => { R.forEach(
it => {
initialValues.smsData[it] = smsData[it] initialValues.smsData[it] = smsData[it]
smsDataElements.push({ smsDataElements.push({
name: it, name: it,
@ -423,7 +423,9 @@ const CustomerData = ({
component: TextInput, component: TextInput,
editable: false editable: false
}) })
}, R.keys(smsData) ?? []) },
R.keys(smsData) ?? []
)
const externalCompliance = R.map(it => ({ const externalCompliance = R.map(it => ({
fields: [ fields: [
@ -492,7 +494,9 @@ const CustomerData = ({
deleteEditedData={deleteEditedData} deleteEditedData={deleteEditedData}
retrieveAdditionalData={retrieveAdditionalData} retrieveAdditionalData={retrieveAdditionalData}
checkAgainstSanctions={checkAgainstSanctions} checkAgainstSanctions={checkAgainstSanctions}
editable={editable}>{children}</EditableCard> editable={editable}>
{children}
</EditableCard>
) )
} }
@ -509,7 +513,9 @@ const CustomerData = ({
titleIcon={titleIcon} titleIcon={titleIcon}
editable={false} editable={false}
hasImage={hasImage} hasImage={hasImage}
fields={fields}>{children}</EditableCard> fields={fields}>
{children}
</EditableCard>
) )
} }
@ -519,7 +525,8 @@ const CustomerData = ({
<div> <div>
<div className={classes.header}> <div className={classes.header}>
<H3 className={classes.title}>{'Customer data'}</H3> <H3 className={classes.title}>{'Customer data'}</H3>
{// TODO: Remove false condition for next release {
// TODO: Remove false condition for next release
// false && ( // false && (
// <> // <>
// <FeatureButton // <FeatureButton

View file

@ -66,8 +66,7 @@ const CustomerNotes = ({
handleClick={setEditing} handleClick={setEditing}
timezone={timezone} timezone={timezone}
/> />
) ))}
)}
</div> </div>
)} )}
{!R.isNil(editing) && ( {!R.isNil(editing) && (

View file

@ -120,9 +120,8 @@ const Customers = () => {
onCompleted: data => setFilteredCustomers(R.path(['customers'])(data)) onCompleted: data => setFilteredCustomers(R.path(['customers'])(data))
}) })
const { data: filtersResponse, loading: loadingFilters } = useQuery( const { data: filtersResponse, loading: loadingFilters } =
GET_CUSTOMER_FILTERS useQuery(GET_CUSTOMER_FILTERS)
)
const [createNewCustomer] = useMutation(CREATE_CUSTOMER, { const [createNewCustomer] = useMutation(CREATE_CUSTOMER, {
onCompleted: () => setShowCreationModal(false), onCompleted: () => setShowCreationModal(false),

View file

@ -38,9 +38,7 @@ const IdCardPhotoCard = memo(({ customerData, updateCustomer }) => {
{customerData.idCardPhotoPath ? ( {customerData.idCardPhotoPath ? (
<img <img
className={classes.idCardPhoto} className={classes.idCardPhoto}
src={`/id-card-photo/${R.path(['idCardPhotoPath'])( src={`/id-card-photo/${R.path(['idCardPhotoPath'])(customerData)}`}
customerData
)}`}
alt="" alt=""
/> />
) : ( ) : (

View file

@ -18,10 +18,7 @@ const initialValues = {
} }
const validationSchema = Yup.object().shape({ const validationSchema = Yup.object().shape({
title: Yup.string() title: Yup.string().required().trim().max(25),
.required()
.trim()
.max(25),
content: Yup.string().required() content: Yup.string().required()
}) })

View file

@ -143,9 +143,9 @@ const getFormattedPhone = (phone, country) => {
const getName = it => { const getName = it => {
const idData = R.path(['idCardData'])(it) const idData = R.path(['idCardData'])(it)
return `${R.path(['firstName'])(idData) ?? ''} ${R.path(['lastName'])( return `${R.path(['firstName'])(idData) ?? ''} ${
idData R.path(['lastName'])(idData) ?? ''
) ?? ''}`.trim() }`.trim()
} }
// Manual Entry Wizard // Manual Entry Wizard

View file

@ -186,9 +186,7 @@ const RefLineChart = ({
useEffect(() => { useEffect(() => {
// first we clear old chart DOM elements on component update // first we clear old chart DOM elements on component update
d3.select(svgRef.current) d3.select(svgRef.current).selectAll('*').remove()
.selectAll('*')
.remove()
drawGraph() drawGraph()
}, [drawGraph, realData]) }, [drawGraph, realData])

View file

@ -211,12 +211,7 @@ const Graph = ({ data, timeFrame, timezone }) => {
g g
.append('g') .append('g')
.selectAll('line') .selectAll('line')
.data( .data(d3.axisLeft(y).scale().ticks(5))
d3
.axisLeft(y)
.scale()
.ticks(5)
)
.join('line') .join('line')
.attr('y1', d => 0.5 + y(d)) .attr('y1', d => 0.5 + y(d))
.attr('y2', d => 0.5 + y(d)) .attr('y2', d => 0.5 + y(d))
@ -240,10 +235,7 @@ const Graph = ({ data, timeFrame, timezone }) => {
) )
// Left side breakpoint label // Left side breakpoint label
.call(g => { .call(g => {
const separator = d3 const separator = d3?.select('.dateSeparator')?.node()?.getBBox()
?.select('.dateSeparator')
?.node()
?.getBBox()
if (!separator) return if (!separator) return
@ -261,10 +253,7 @@ const Graph = ({ data, timeFrame, timezone }) => {
}) })
// Right side breakpoint label // Right side breakpoint label
.call(g => { .call(g => {
const separator = d3 const separator = d3?.select('.dateSeparator')?.node()?.getBBox()
?.select('.dateSeparator')
?.node()
?.getBBox()
if (!separator) return if (!separator) return
@ -355,9 +344,7 @@ const Graph = ({ data, timeFrame, timezone }) => {
]) ])
useEffect(() => { useEffect(() => {
d3.select(ref.current) d3.select(ref.current).selectAll('*').remove()
.selectAll('*')
.remove()
drawChart() drawChart()
}, [drawChart]) }, [drawChart])

View file

@ -114,8 +114,7 @@ const MachinesTable = ({ machines = [], numToRender }) => {
<Label2 className={classes.label}> {it + 1}</Label2> <Label2 className={classes.label}> {it + 1}</Label2>
</div> </div>
</HeaderCell> </HeaderCell>
) ))}
)}
</TableRow> </TableRow>
</TableHead> </TableHead>
<TableBody> <TableBody>

View file

@ -153,42 +153,18 @@ const overrides = (auxData, auxElements, configureCoin) => {
} }
const LocaleSchema = Yup.object().shape({ const LocaleSchema = Yup.object().shape({
country: Yup.string() country: Yup.string().label('Country').required(),
.label('Country') fiatCurrency: Yup.string().label('Fiat currency').required(),
.required(), languages: Yup.array().label('Languages').required().min(1).max(4),
fiatCurrency: Yup.string() cryptoCurrencies: Yup.array().label('Crypto currencies').required().min(1),
.label('Fiat currency') timezone: Yup.string().label('Timezone').required()
.required(),
languages: Yup.array()
.label('Languages')
.required()
.min(1)
.max(4),
cryptoCurrencies: Yup.array()
.label('Crypto currencies')
.required()
.min(1),
timezone: Yup.string()
.label('Timezone')
.required()
}) })
const OverridesSchema = Yup.object().shape({ const OverridesSchema = Yup.object().shape({
machine: Yup.string() machine: Yup.string().label('Machine').required(),
.label('Machine') country: Yup.string().label('Country').required(),
.required(), languages: Yup.array().label('Languages').required().min(1).max(4),
country: Yup.string() cryptoCurrencies: Yup.array().label('Crypto currencies').required().min(1)
.label('Country')
.required(),
languages: Yup.array()
.label('Languages')
.required()
.min(1)
.max(4),
cryptoCurrencies: Yup.array()
.label('Crypto currencies')
.required()
.min(1)
}) })
const localeDefaults = { const localeDefaults = {

View file

@ -65,9 +65,8 @@ const IndividualDiscounts = () => {
const { data: discountResponse, loading: discountLoading } = useQuery( const { data: discountResponse, loading: discountLoading } = useQuery(
GET_INDIVIDUAL_DISCOUNTS GET_INDIVIDUAL_DISCOUNTS
) )
const { data: customerData, loading: customerLoading } = useQuery( const { data: customerData, loading: customerLoading } =
GET_CUSTOMERS useQuery(GET_CUSTOMERS)
)
const [createDiscount, { error: creationError }] = useMutation( const [createDiscount, { error: creationError }] = useMutation(
CREATE_DISCOUNT, CREATE_DISCOUNT,

View file

@ -21,14 +21,8 @@ const initialValues = {
} }
const validationSchema = Yup.object().shape({ const validationSchema = Yup.object().shape({
code: Yup.string() code: Yup.string().required().trim().max(25),
.required() discount: Yup.number().required().min(0).max(100)
.trim()
.max(25),
discount: Yup.number()
.required()
.min(0)
.max(100)
}) })
const PromoCodesModal = ({ showModal, onClose, errorMsg, addCode }) => { const PromoCodesModal = ({ showModal, onClose, errorMsg, addCode }) => {

View file

@ -81,9 +81,8 @@ const Logs = () => {
const deviceId = selected?.deviceId const deviceId = selected?.deviceId
const { data: machineResponse, loading: machinesLoading } = useQuery( const { data: machineResponse, loading: machinesLoading } =
GET_MACHINES useQuery(GET_MACHINES)
)
const { data: configResponse, loading: configLoading } = useQuery(GET_DATA) const { data: configResponse, loading: configLoading } = useQuery(GET_DATA)
const timezone = R.path(['config', 'locale_timezone'], configResponse) const timezone = R.path(['config', 'locale_timezone'], configResponse)

View file

@ -106,7 +106,7 @@ const CashUnitDetails = ({
<div className={classes.billList}> <div className={classes.billList}>
<Label1>Cash box</Label1> <Label1>Cash box</Label1>
{R.isEmpty(billCount) && <TL2 noMargin>Empty</TL2>} {R.isEmpty(billCount) && <TL2 noMargin>Empty</TL2>}
{(R.keys(billCount)).map((it, idx) => ( {R.keys(billCount).map((it, idx) => (
<span key={idx}> <span key={idx}>
<TL2 noMargin>{billCount[it]}</TL2> <TL2 noMargin>{billCount[it]}</TL2>
<Chip label={`${it} ${currency}`} /> <Chip label={`${it} ${currency}`} />
@ -149,7 +149,7 @@ const CashUnitDetails = ({
noMargin noMargin
className={classes.label}>{`Loading boxes`}</Label1> className={classes.label}>{`Loading boxes`}</Label1>
<div className={classes.loadingBoxes}> <div className={classes.loadingBoxes}>
{(R.range(1, machine.numberOfCassettes + 1)).map((it, idx) => ( {R.range(1, machine.numberOfCassettes + 1).map((it, idx) => (
<CashOut <CashOut
key={idx} key={idx}
width={60} width={60}

View file

@ -182,10 +182,8 @@ const WizardStep = ({
const numberOfCassettes = machine.numberOfCassettes const numberOfCassettes = machine.numberOfCassettes
const numberOfRecyclers = machine.numberOfRecyclers const numberOfRecyclers = machine.numberOfRecyclers
const { const { name: cashUnitField, category: cashUnitCategory } =
name: cashUnitField, getCashUnitFieldName(step, numberOfCassettes, numberOfRecyclers)
category: cashUnitCategory
} = getCashUnitFieldName(step, numberOfCassettes, numberOfRecyclers)
const originalCashUnitCount = machine?.cashUnits?.[cashUnitField] const originalCashUnitCount = machine?.cashUnits?.[cashUnitField]
const cashUnitDenomination = cashoutSettings?.[cashUnitField] const cashUnitDenomination = cashoutSettings?.[cashUnitField]

View file

@ -57,7 +57,7 @@ const getElements = (
return ( return (
<div className={classes.unitsRow}> <div className={classes.unitsRow}>
<div className={classes.units}> <div className={classes.units}>
{(R.range(1, m.numberOfCassettes + 1)).map((it, idx) => ( {R.range(1, m.numberOfCassettes + 1).map((it, idx) => (
<CashOutLite <CashOutLite
key={idx} key={idx}
width={'100%'} width={'100%'}

View file

@ -33,14 +33,8 @@ const SingleFieldEditableNumber = ({
setSaving(false) setSaving(false)
} }
const { const { save, data, currency, isEditing, isDisabled, setEditing } =
save, useContext(NotificationsCtx)
data,
currency,
isEditing,
isDisabled,
setEditing
} = useContext(NotificationsCtx)
const schema = Yup.object().shape({ const schema = Yup.object().shape({
[name]: Yup.number() [name]: Yup.number()

View file

@ -14,14 +14,8 @@ const useStyles = makeStyles(styles)
const CryptoBalanceAlerts = ({ section, fieldWidth }) => { const CryptoBalanceAlerts = ({ section, fieldWidth }) => {
const classes = useStyles() const classes = useStyles()
const { const { data, save, currency, setEditing, isEditing, isDisabled } =
data, useContext(NotificationsCtx)
save,
currency,
setEditing,
isEditing,
isDisabled
} = useContext(NotificationsCtx)
return ( return (
<div className={classes.cryptoBalanceAlerts}> <div className={classes.cryptoBalanceAlerts}>

View file

@ -79,9 +79,7 @@ const FiatBalanceOverrides = ({ config, section }) => {
const percentMax = 100 const percentMax = 100
const validationSchema = Yup.object() const validationSchema = Yup.object()
.shape({ .shape({
[MACHINE_KEY]: Yup.string() [MACHINE_KEY]: Yup.string().label('Machine').required(),
.label('Machine')
.required(),
[CASHBOX_KEY]: Yup.number() [CASHBOX_KEY]: Yup.number()
.label('Cash box') .label('Cash box')
.transform(transformNumber) .transform(transformNumber)

View file

@ -11,9 +11,12 @@ import NotificationsCtx from '../NotificationsContext'
const filterClass = type => R.filter(it => it.class === type) const filterClass = type => R.filter(it => it.class === type)
const ThirdPartyProvider = () => { const ThirdPartyProvider = () => {
const { save, data: _data, error, accountsConfig } = useContext( const {
NotificationsCtx save,
) data: _data,
error,
accountsConfig
} = useContext(NotificationsCtx)
const data = fromNamespace('thirdParty')(_data) const data = fromNamespace('thirdParty')(_data)

View file

@ -82,7 +82,8 @@ const formatContent = content => {
const TOOLTIPS = { const TOOLTIPS = {
smsCode: ``, smsCode: ``,
cashOutDispenseReady: ``, cashOutDispenseReady: ``,
smsReceipt: formatContent(`The contents of this notice will be appended to the end of the SMS receipt sent, and not replace it.\n smsReceipt:
formatContent(`The contents of this notice will be appended to the end of the SMS receipt sent, and not replace it.\n
To edit the contents of the SMS receipt, please go to the 'Receipt' tab`) To edit the contents of the SMS receipt, please go to the 'Receipt' tab`)
} }
@ -124,9 +125,8 @@ const SMSNotices = () => {
const [previewCoords, setPreviewCoords] = useState({ x: 0, y: 0 }) const [previewCoords, setPreviewCoords] = useState({ x: 0, y: 0 })
const [errorMsg, setErrorMsg] = useState('') const [errorMsg, setErrorMsg] = useState('')
const { data: messagesData, loading: messagesLoading } = useQuery( const { data: messagesData, loading: messagesLoading } =
GET_SMS_NOTICES useQuery(GET_SMS_NOTICES)
)
const timezone = R.path(['config', 'locale_timezone'])(messagesData) const timezone = R.path(['config', 'locale_timezone'])(messagesData)

View file

@ -44,9 +44,7 @@ const PREFILL = {
}) })
}, },
cashOutDispenseReady: { cashOutDispenseReady: {
validator: Yup.string() validator: Yup.string().required('The message content is required!').trim()
.required('The message content is required!')
.trim()
}, },
smsReceipt: { smsReceipt: {
validator: Yup.string().trim() validator: Yup.string().trim()
@ -89,9 +87,7 @@ const SMSNoticesModal = ({
event: Yup.string().required('An event is required!'), event: Yup.string().required('An event is required!'),
message: message:
PREFILL[sms?.event]?.validator ?? PREFILL[sms?.event]?.validator ??
Yup.string() Yup.string().required('The message content is required!').trim()
.required('The message content is required!')
.trim()
}) })
const handleSubmit = values => { const handleSubmit = values => {
@ -155,11 +151,9 @@ const SMSNoticesModal = ({
<Info2 noMargin>Values to attach</Info2> <Info2 noMargin>Values to attach</Info2>
)} )}
<div className={classes.chipButtons}> <div className={classes.chipButtons}>
{R.splitEvery(3, CHIPS[sms?.event]).map( {R.splitEvery(3, CHIPS[sms?.event]).map((it, idx) => (
(it, idx) => (
<div key={idx}> <div key={idx}>
{it.map( {it.map((ite, idx2) => (
(ite, idx2) => (
<Chip <Chip
key={idx2} key={idx2}
label={ite.display} label={ite.display}
@ -177,11 +171,9 @@ const SMSNoticesModal = ({
) )
}} }}
/> />
) ))}
)}
</div> </div>
), ))}
)}
</div> </div>
<div className={classes.footer}> <div className={classes.footer}>
{getErrorMsg(errors, touched, creationError) && ( {getErrorMsg(errors, touched, creationError) && (

View file

@ -30,10 +30,7 @@ const leadingZerosTest = (value, context) => {
} }
const buildCurrencyOptions = markets => { const buildCurrencyOptions = markets => {
const prunedCoins = R.compose( const prunedCoins = R.compose(R.uniq, R.map(getEquivalentCode))(ALL_CRYPTOS)
R.uniq,
R.map(getEquivalentCode)
)(ALL_CRYPTOS)
return R.map(it => { return R.map(it => {
const unavailableCryptos = R.difference(prunedCoins, markets[it]) const unavailableCryptos = R.difference(prunedCoins, markets[it])
const unavailableCryptosFiltered = R.difference(unavailableCryptos, [it]) // As the markets can have stablecoins to trade against other crypto, filter them out, as there can't be pairs such as USDT/USDT const unavailableCryptosFiltered = R.difference(unavailableCryptos, [it]) // As the markets can have stablecoins to trade against other crypto, filter them out, as there can't be pairs such as USDT/USDT

View file

@ -132,14 +132,10 @@ const DetailsRow = ({ it: tx, timezone }) => {
Number.parseFloat(tx.commissionPercentage, 2) * 100 Number.parseFloat(tx.commissionPercentage, 2) * 100
).toFixed(2, 1) // ROUND_DOWN ).toFixed(2, 1) // ROUND_DOWN
const fixedFee = Number.parseFloat(tx.fixedFee) || 0 const fixedFee = Number.parseFloat(tx.fixedFee) || 0
const fiat = BigNumber(tx.fiat) const fiat = BigNumber(tx.fiat).minus(fixedFee).toFixed(2, 1) // ROUND_DOWN
.minus(fixedFee)
.toFixed(2, 1) // ROUND_DOWN
const crypto = getCryptoAmount(tx) const crypto = getCryptoAmount(tx)
const cryptoFee = tx.fee ? `${getCryptoFeeAmount(tx)} ${tx.fiatCode}` : 'N/A' const cryptoFee = tx.fee ? `${getCryptoFeeAmount(tx)} ${tx.fiatCode}` : 'N/A'
const exchangeRate = BigNumber(fiat) const exchangeRate = BigNumber(fiat).div(crypto).toFixed(2, 1) // ROUND_DOWN
.div(crypto)
.toFixed(2, 1) // ROUND_DOWN
const displayExRate = `1 ${tx.cryptoCode} = ${exchangeRate} ${tx.fiatCode}` const displayExRate = `1 ${tx.cryptoCode} = ${exchangeRate} ${tx.fiatCode}`
const discount = tx.discount ? `-${tx.discount}%` : null const discount = tx.discount ? `-${tx.discount}%` : null
@ -218,8 +214,7 @@ const DetailsRow = ({ it: tx, timezone }) => {
: offErrorColor : offErrorColor
} }
/> />
) ))}
)}
</svg> </svg>
<P <P
noMargin noMargin

View file

@ -65,9 +65,7 @@ const ChooseType = () => {
} }
const validationSchema = Yup.object().shape({ const validationSchema = Yup.object().shape({
inputType: Yup.string() inputType: Yup.string().label('Input type').required()
.label('Input type')
.required()
}) })
const defaultValues = { const defaultValues = {

View file

@ -31,12 +31,8 @@ const Screen1Information = () => {
} }
const validationSchema = Yup.object().shape({ const validationSchema = Yup.object().shape({
screen1Title: Yup.string() screen1Title: Yup.string().label('Screen title').required(),
.label('Screen title') screen1Text: Yup.string().label('Screen text').required()
.required(),
screen1Text: Yup.string()
.label('Screen text')
.required()
}) })
const defaultValues = { const defaultValues = {

View file

@ -29,12 +29,8 @@ const ScreenInformation = () => {
} }
const validationSchema = Yup.object().shape({ const validationSchema = Yup.object().shape({
screen2Title: Yup.string() screen2Title: Yup.string().label('Screen title').required(),
.label('Screen title') screen2Text: Yup.string().label('Screen text').required()
.required(),
screen2Text: Yup.string()
.label('Screen text')
.required()
}) })
const defaultValues = { const defaultValues = {

View file

@ -40,38 +40,27 @@ const validationSchema = Yup.lazy(values => {
switch (values.inputType) { switch (values.inputType) {
case 'numerical': case 'numerical':
return Yup.object({ return Yup.object({
constraintType: Yup.string() constraintType: Yup.string().label('Constraint type').required(),
.label('Constraint type')
.required(),
inputLength: Yup.number().when('constraintType', { inputLength: Yup.number().when('constraintType', {
is: 'length', is: 'length',
then: schema => schema then: schema =>
.min(0) schema.min(0).required('The number of digits is required'),
.required('The number of digits is required'),
otherwise: schema => schema.mixed().notRequired() otherwise: schema => schema.mixed().notRequired()
}) })
}) })
case 'text': case 'text':
return Yup.object({ return Yup.object({
constraintType: Yup.string() constraintType: Yup.string().label('Constraint type').required(),
.label('Constraint type') inputLabel1: Yup.string().label('Text entry label').required(),
.required(),
inputLabel1: Yup.string()
.label('Text entry label')
.required(),
inputLabel2: Yup.string().when('constraintType', { inputLabel2: Yup.string().when('constraintType', {
is: 'spaceSeparation', is: 'spaceSeparation',
then: schema => schema then: schema => schema.label('Second word label').required(),
.label('Second word label')
.required(),
otherwise: schema => schema.mixed().notRequired() otherwise: schema => schema.mixed().notRequired()
}) })
}) })
case 'choiceList': case 'choiceList':
return Yup.object({ return Yup.object({
constraintType: Yup.string() constraintType: Yup.string().label('Constraint type').required(),
.label('Constraint type')
.required(),
listChoices: Yup.array().test( listChoices: Yup.array().test(
'has-2-or-more', 'has-2-or-more',
'Choice list needs to have two or more non empty fields', 'Choice list needs to have two or more non empty fields',

View file

@ -65,9 +65,8 @@ const Triggers = () => {
const classes = useStyles() const classes = useStyles()
const [wizardType, setWizard] = useState(false) const [wizardType, setWizard] = useState(false)
const { data, loading: configLoading, refetch } = useQuery(GET_CONFIG) const { data, loading: configLoading, refetch } = useQuery(GET_CONFIG)
const { data: customInfoReqData, loading: customInfoLoading } = useQuery( const { data: customInfoReqData, loading: customInfoLoading } =
GET_CUSTOM_REQUESTS useQuery(GET_CUSTOM_REQUESTS)
)
const [error, setError] = useState(null) const [error, setError] = useState(null)
const [subMenu, setSubMenu] = useState(false) const [subMenu, setSubMenu] = useState(false)

View file

@ -45,9 +45,8 @@ const AdvancedTriggersSettings = memo(() => {
const [isEditingOverrides, setEditingOverrides] = useState(false) const [isEditingOverrides, setEditingOverrides] = useState(false)
const { data, loading: configLoading } = useQuery(GET_INFO) const { data, loading: configLoading } = useQuery(GET_INFO)
const { data: customInfoReqData, loading: customInfoLoading } = useQuery( const { data: customInfoReqData, loading: customInfoLoading } =
GET_CUSTOM_REQUESTS useQuery(GET_CUSTOM_REQUESTS)
)
const customInfoRequests = const customInfoRequests =
R.path(['customInfoRequests'])(customInfoReqData) ?? [] R.path(['customInfoRequests'])(customInfoReqData) ?? []

View file

@ -30,9 +30,7 @@ const displayRequirement = (code, customInfoRequests) => {
} }
const defaultSchema = Yup.object().shape({ const defaultSchema = Yup.object().shape({
expirationTime: Yup.string() expirationTime: Yup.string().label('Expiration time').required(),
.label('Expiration time')
.required(),
automation: Yup.string() automation: Yup.string()
.label('Automation') .label('Automation')
.matches(/(Manual|Automatic)/) .matches(/(Manual|Automatic)/)
@ -60,9 +58,7 @@ const getOverridesSchema = (values, customInfoRequests) => {
return true return true
} }
}), }),
expirationTime: Yup.string() expirationTime: Yup.string().label('Expiration time').required(),
.label('Expiration time')
.required(),
automation: Yup.string() automation: Yup.string()
.label('Automation') .label('Automation')
.matches(/(Manual|Automatic)/) .matches(/(Manual|Automatic)/)

View file

@ -110,9 +110,7 @@ const threshold = Yup.object().shape({
const requirement = Yup.object().shape({ const requirement = Yup.object().shape({
requirement: Yup.string().required(), requirement: Yup.string().required(),
suspensionDays: Yup.number() suspensionDays: Yup.number().transform(transformNumber).nullable()
.transform(transformNumber)
.nullable()
}) })
const Schema = Yup.object() const Schema = Yup.object()
@ -266,12 +264,8 @@ const typeSchema = Yup.object()
'The trigger type is required' 'The trigger type is required'
), ),
threshold: Yup.object({ threshold: Yup.object({
threshold: Yup.number() threshold: Yup.number().transform(transformNumber).nullable(),
.transform(transformNumber) thresholdDays: Yup.number().transform(transformNumber).nullable()
.nullable(),
thresholdDays: Yup.number()
.transform(transformNumber)
.nullable()
}) })
}) })
.test(({ threshold, triggerType }, context) => { .test(({ threshold, triggerType }, context) => {
@ -327,13 +321,8 @@ const typeOptions = [
const Type = ({ ...props }) => { const Type = ({ ...props }) => {
const classes = useStyles() const classes = useStyles()
const { const { errors, touched, values, setTouched, handleChange } =
errors, useFormikContext()
touched,
values,
setTouched,
handleChange
} = useFormikContext()
const typeClass = { const typeClass = {
[classes.error]: errors.triggerType && touched.triggerType [classes.error]: errors.triggerType && touched.triggerType
@ -484,24 +473,16 @@ const requirementSchema = Yup.object()
requirement: Yup.string().required(), requirement: Yup.string().required(),
suspensionDays: Yup.number().when('requirement', { suspensionDays: Yup.number().when('requirement', {
is: value => value === 'suspend', is: value => value === 'suspend',
then: schema => schema then: schema => schema.nullable().transform(transformNumber),
.nullable() otherwise: schema => schema.nullable().transform(() => null)
.transform(transformNumber),
otherwise: schema => schema
.nullable()
.transform(() => null)
}), }),
customInfoRequestId: Yup.string().when('requirement', { customInfoRequestId: Yup.string().when('requirement', {
is: value => value !== 'custom', is: value => value !== 'custom',
then: schema => schema then: schema => schema.nullable().transform(() => '')
.nullable()
.transform(() => '')
}), }),
externalService: Yup.string().when('requirement', { externalService: Yup.string().when('requirement', {
is: value => value !== 'external', is: value => value !== 'external',
then: schema => schema then: schema => schema.nullable().transform(() => '')
.nullable()
.transform(() => '')
}) })
}).required() }).required()
}) })
@ -583,13 +564,8 @@ const Requirement = ({
customInfoRequests = [] customInfoRequests = []
}) => { }) => {
const classes = useStyles() const classes = useStyles()
const { const { touched, errors, values, handleChange, setTouched } =
touched, useFormikContext()
errors,
values,
handleChange,
setTouched
} = useFormikContext()
const isSuspend = values?.requirement?.requirement === 'suspend' const isSuspend = values?.requirement?.requirement === 'suspend'
const isCustom = values?.requirement?.requirement === 'custom' const isCustom = values?.requirement?.requirement === 'custom'
@ -766,9 +742,9 @@ const RequirementInput = ({ customInfoRequests = [] }) => {
R.path(['requirement', 'customInfoRequestId'])(values) ?? '' R.path(['requirement', 'customInfoRequestId'])(values) ?? ''
const isSuspend = requirement === 'suspend' const isSuspend = requirement === 'suspend'
const display = customRequestId const display = customRequestId
? R.path(['customRequest', 'name'])( ? (R.path(['customRequest', 'name'])(
R.find(customReqIdMatches(customRequestId))(customInfoRequests) R.find(customReqIdMatches(customRequestId))(customInfoRequests)
) ?? '' ) ?? '')
: getView(requirementOptions, 'display')(requirement) : getView(requirementOptions, 'display')(requirement)
return ( return (
@ -798,9 +774,9 @@ const RequirementView = ({
const classes = useStyles() const classes = useStyles()
const display = const display =
requirement === 'custom' requirement === 'custom'
? R.path(['customRequest', 'name'])( ? (R.path(['customRequest', 'name'])(
R.find(customReqIdMatches(customInfoRequestId))(customInfoRequests) R.find(customReqIdMatches(customInfoRequestId))(customInfoRequests)
) ?? '' ) ?? '')
: requirement === 'external' : requirement === 'external'
? `External verification (${onlyFirstToUpper(externalService)})` ? `External verification (${onlyFirstToUpper(externalService)})`
: getView(requirementOptions, 'display')(requirement) : getView(requirementOptions, 'display')(requirement)

View file

@ -119,8 +119,7 @@ const Routes = () => {
{...transitionProps} {...transitionProps}
in={true} in={true}
mountOnEnter mountOnEnter
unmountOnExit unmountOnExit>
>
<div className={classes.wrapper}> <div className={classes.wrapper}>
<Dashboard /> <Dashboard />
</div> </div>
@ -139,8 +138,7 @@ const Routes = () => {
{...transitionProps} {...transitionProps}
in={!!matchPath(location.pathname, { path: route })} in={!!matchPath(location.pathname, { path: route })}
mountOnEnter mountOnEnter
unmountOnExit unmountOnExit>
>
<div className={classes.wrapper}> <div className={classes.wrapper}>
<PrivateRoute path={route} key={key}> <PrivateRoute path={route} key={key}>
<Page name={key} /> <Page name={key} />

View file

@ -6,7 +6,8 @@ const WALLET_SCORING_DEFAULT_THRESHOLD = 9
const AUTOMATIC = 'automatic' const AUTOMATIC = 'automatic'
const MANUAL = 'manual' const MANUAL = 'manual'
const IP_CHECK_REGEX = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/ const IP_CHECK_REGEX =
/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
const SWEEPABLE_CRYPTOS = ['ETH'] const SWEEPABLE_CRYPTOS = ['ETH']

View file

@ -20,11 +20,7 @@ const splitOnUpper = R.compose(
R.replace(/([A-Z])/g, ' $1'), R.replace(/([A-Z])/g, ' $1'),
toFirstLower toFirstLower
) )
const startCase = R.compose( const startCase = R.compose(R.join(' '), R.map(onlyFirstToUpper), splitOnUpper)
R.join(' '),
R.map(onlyFirstToUpper),
splitOnUpper
)
const sentenceCase = R.compose(onlyFirstToUpper, R.join(' '), splitOnUpper) const sentenceCase = R.compose(onlyFirstToUpper, R.join(' '), splitOnUpper)

View file

@ -7,6 +7,9 @@ import fixReactVirtualized from 'esbuild-plugin-react-virtualized'
export default defineConfig({ export default defineConfig({
base: '/', base: '/',
build: {
outDir: 'build'
},
server: { server: {
port: 3001, port: 3001,
proxy: { proxy: {
@ -19,18 +22,13 @@ export default defineConfig({
}, },
optimizeDeps: { optimizeDeps: {
esbuildOptions: { esbuildOptions: {
plugins: [ plugins: [fixReactVirtualized]
fixReactVirtualized,
],
} }
}, },
plugins: [ plugins: [react(), svgr()],
react(),
svgr(),
],
resolve: { resolve: {
alias: { alias: {
'src': fileURLToPath(new URL('./src', import.meta.url)) src: fileURLToPath(new URL('./src', import.meta.url))
}, }
}, }
}) })