feat: change customer screen transaction list part to the new design

feat: created the compliance details component (no data for now)

fix: added missing properties into the gql schema and the compliance
details component

feat: added another chip type for a neutral situation

style: change the property card style for the v1 specs

fix: added front facing camera override to schema and components

feat: added authorized override (status) column to the customers list
table

fix: moved name to the front of the phone on the customers list table

fix: added sanctions description text on it's card

fix: added id icon to the right of the customer name

feat: created subpage button component and use it in the customer
profile

feat: created an image popper component and use it in the customer
compliance page

fix: added varying sizes to the customer details and id data cards fields

refactor: simplify the compliance subpage code
This commit is contained in:
Liordino Neto 2020-10-16 18:11:45 -03:00 committed by Josh Harvey
parent 8ff0a7f79b
commit f53a934092
28 changed files with 744 additions and 260 deletions

View file

@ -4,6 +4,7 @@ import moment from 'moment'
import * as R from 'ramda'
import React from 'react'
import { MainStatus } from 'src/components/Status'
import TitleSection from 'src/components/layout/TitleSection'
import DataTable from 'src/components/tables/DataTable'
import { ReactComponent as TxInIcon } from 'src/styling/icons/direction/cash-in.svg'
@ -14,42 +15,58 @@ import styles from './CustomersList.styles'
const useStyles = makeStyles(styles)
const CustomersList = ({ data, onClick, loading }) => {
const CUSTOMER_VERIFIED = 'verified'
const CUSTOMER_BLOCKED = 'blocked'
const CustomersList = ({ data, locale, onClick, loading }) => {
const classes = useStyles()
const getAuthorizedStatus = authorizedOverride =>
authorizedOverride === CUSTOMER_VERIFIED
? { label: 'Authorized', type: 'success' }
: authorizedOverride === CUSTOMER_BLOCKED
? { label: 'Blocked', type: 'error' }
: { label: 'Suspended', type: 'warning' }
const elements = [
{
header: 'Phone',
width: 186,
view: it => parsePhoneNumberFromString(it.phone).formatInternational()
},
{
header: 'Name',
width: 277,
width: 241,
view: R.path(['name'])
},
{
header: 'Phone',
width: 172,
view: it =>
it.phone && locale.country
? parsePhoneNumberFromString(
it.phone,
locale.country
).formatInternational()
: ''
},
{
header: 'Total TXs',
width: 154,
width: 126,
textAlign: 'right',
view: it => `${Number.parseInt(it.totalTxs)}`
},
{
header: 'Total spent',
width: 188,
width: 152,
textAlign: 'right',
view: it =>
`${Number.parseFloat(it.totalSpent)} ${it.lastTxFiatCode ?? ''}`
},
{
header: 'Last active',
width: 197,
width: 133,
view: it =>
ifNotNull(it.lastActive, moment.utc(it.lastActive).format('YYYY-MM-D'))
},
{
header: 'Last transaction',
width: 198,
width: 161,
textAlign: 'right',
view: it => {
const hasLastTx = !R.isNil(it.lastTxFiatCode)
@ -63,6 +80,13 @@ const CustomersList = ({ data, onClick, loading }) => {
</>
)
}
},
{
header: 'Status',
width: 188,
view: it => (
<MainStatus statuses={[getAuthorizedStatus(it.authorizedOverride)]} />
)
}
]