fix: commissions UI
fix: remove logs
This commit is contained in:
parent
62269699fc
commit
44980bbf9c
5 changed files with 43 additions and 6 deletions
|
|
@ -33,7 +33,8 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buttonIconActiveLeft: {
|
buttonIconActiveLeft: {
|
||||||
marginRight: 12
|
marginRight: 12,
|
||||||
|
marginLeft: 4
|
||||||
},
|
},
|
||||||
buttonIconActiveRight: {
|
buttonIconActiveRight: {
|
||||||
marginRight: 5,
|
marginRight: 5,
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import React from 'react'
|
||||||
import ErrorMessage from 'src/components/ErrorMessage'
|
import ErrorMessage from 'src/components/ErrorMessage'
|
||||||
import Title from 'src/components/Title'
|
import Title from 'src/components/Title'
|
||||||
import { SubpageButton } from 'src/components/buttons'
|
import { SubpageButton } from 'src/components/buttons'
|
||||||
import { Label1 } from 'src/components/typography'
|
import { Info1, Label1 } from 'src/components/typography'
|
||||||
|
|
||||||
import styles from './TitleSection.styles'
|
import styles from './TitleSection.styles'
|
||||||
|
|
||||||
|
|
@ -33,7 +33,7 @@ const TitleSection = ({
|
||||||
Icon={button.icon}
|
Icon={button.icon}
|
||||||
InverseIcon={button.inverseIcon}
|
InverseIcon={button.inverseIcon}
|
||||||
toggle={button.toggle}>
|
toggle={button.toggle}>
|
||||||
{button.text}
|
<Info1 className={classes.buttonText}>{button.text}</Info1>
|
||||||
</SubpageButton>
|
</SubpageButton>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { backgroundColor } from 'src/styling/variables'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
titleWrapper: {
|
titleWrapper: {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|
@ -15,6 +17,10 @@ export default {
|
||||||
subpageButton: {
|
subpageButton: {
|
||||||
marginLeft: 12
|
marginLeft: 12
|
||||||
},
|
},
|
||||||
|
buttonText: {
|
||||||
|
color: `${backgroundColor}`,
|
||||||
|
fontSize: 15
|
||||||
|
},
|
||||||
icon: {
|
icon: {
|
||||||
marginRight: 6
|
marginRight: 6
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
import { useQuery, useMutation } from '@apollo/react-hooks'
|
import { useQuery, useMutation } from '@apollo/react-hooks'
|
||||||
|
import { makeStyles } from '@material-ui/core'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import * as R from 'ramda'
|
import * as R from 'ramda'
|
||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
|
|
||||||
import TitleSection from 'src/components/layout/TitleSection'
|
import TitleSection from 'src/components/layout/TitleSection'
|
||||||
import { ReactComponent as ExeceptionViewIcon } from 'src/styling/icons/circle buttons/exception-view/white.svg'
|
import { ReactComponent as ReverseListingViewIcon } from 'src/styling/icons/circle buttons/listing-view/white.svg'
|
||||||
import { ReactComponent as ListingViewIcon } from 'src/styling/icons/circle buttons/listing-view/zodiac.svg'
|
import { ReactComponent as ListingViewIcon } from 'src/styling/icons/circle buttons/listing-view/zodiac.svg'
|
||||||
import { ReactComponent as OverrideLabelIcon } from 'src/styling/icons/status/spring2.svg'
|
import { ReactComponent as OverrideLabelIcon } from 'src/styling/icons/status/spring2.svg'
|
||||||
import { fromNamespace, toNamespace, namespaces } from 'src/utils/config'
|
import { fromNamespace, toNamespace, namespaces } from 'src/utils/config'
|
||||||
|
|
@ -12,6 +13,14 @@ import { fromNamespace, toNamespace, namespaces } from 'src/utils/config'
|
||||||
import CommissionsDetails from './components/CommissionsDetails'
|
import CommissionsDetails from './components/CommissionsDetails'
|
||||||
import CommissionsList from './components/CommissionsList'
|
import CommissionsList from './components/CommissionsList'
|
||||||
|
|
||||||
|
const styles = {
|
||||||
|
listViewButton: {
|
||||||
|
marginLeft: 4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const useStyles = makeStyles(styles)
|
||||||
|
|
||||||
const GET_DATA = gql`
|
const GET_DATA = gql`
|
||||||
query getData {
|
query getData {
|
||||||
config
|
config
|
||||||
|
|
@ -37,6 +46,7 @@ const removeCoinFromOverride = crypto => override =>
|
||||||
})
|
})
|
||||||
|
|
||||||
const Commissions = ({ name: SCREEN_KEY }) => {
|
const Commissions = ({ name: SCREEN_KEY }) => {
|
||||||
|
const classes = useStyles()
|
||||||
const [showMachines, setShowMachines] = useState(false)
|
const [showMachines, setShowMachines] = useState(false)
|
||||||
const [error, setError] = useState(null)
|
const [error, setError] = useState(null)
|
||||||
const { data } = useQuery(GET_DATA)
|
const { data } = useQuery(GET_DATA)
|
||||||
|
|
@ -102,9 +112,10 @@ const Commissions = ({ name: SCREEN_KEY }) => {
|
||||||
button={{
|
button={{
|
||||||
text: 'List view',
|
text: 'List view',
|
||||||
icon: ListingViewIcon,
|
icon: ListingViewIcon,
|
||||||
inverseIcon: ExeceptionViewIcon,
|
inverseIcon: ReverseListingViewIcon,
|
||||||
toggle: setShowMachines
|
toggle: setShowMachines
|
||||||
}}
|
}}
|
||||||
|
iconClassName={classes.listViewButton}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{!showMachines && (
|
{!showMachines && (
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,12 @@ const cashOutHeader = (
|
||||||
const getView = (data, code, compare) => it => {
|
const getView = (data, code, compare) => it => {
|
||||||
if (!data) return ''
|
if (!data) return ''
|
||||||
|
|
||||||
return R.compose(R.prop(code), R.find(R.propEq(compare ?? 'code', it)))(data)
|
// The following boolean should come undefined if it is rendering an unpaired machine
|
||||||
|
const hasValue = R.find(R.propEq(compare ?? 'code', it))(data)
|
||||||
|
|
||||||
|
return hasValue
|
||||||
|
? R.compose(R.prop(code), R.find(R.propEq(compare ?? 'code', it)))(data)
|
||||||
|
: 'Unpaired machine'
|
||||||
}
|
}
|
||||||
|
|
||||||
const displayCodeArray = data => it => {
|
const displayCodeArray = data => it => {
|
||||||
|
|
@ -63,6 +68,12 @@ const onCryptoChange = (prev, curr, setValue) => {
|
||||||
setValue(curr)
|
setValue(curr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const boldStyle = () => {
|
||||||
|
return {
|
||||||
|
fontWeight: 'bold'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const getOverridesFields = (getData, currency, auxElements) => {
|
const getOverridesFields = (getData, currency, auxElements) => {
|
||||||
const machineData = [ALL_MACHINES].concat(getData(['machines']))
|
const machineData = [ALL_MACHINES].concat(getData(['machines']))
|
||||||
const rawCryptos = getData(['cryptoCurrencies'])
|
const rawCryptos = getData(['cryptoCurrencies'])
|
||||||
|
|
@ -105,6 +116,7 @@ const getOverridesFields = (getData, currency, auxElements) => {
|
||||||
input: NumberInput,
|
input: NumberInput,
|
||||||
textAlign: 'right',
|
textAlign: 'right',
|
||||||
suffix: '%',
|
suffix: '%',
|
||||||
|
textStyle: boldStyle,
|
||||||
inputProps: {
|
inputProps: {
|
||||||
decimalPlaces: 3
|
decimalPlaces: 3
|
||||||
}
|
}
|
||||||
|
|
@ -117,6 +129,7 @@ const getOverridesFields = (getData, currency, auxElements) => {
|
||||||
input: NumberInput,
|
input: NumberInput,
|
||||||
textAlign: 'right',
|
textAlign: 'right',
|
||||||
suffix: '%',
|
suffix: '%',
|
||||||
|
textStyle: boldStyle,
|
||||||
inputProps: {
|
inputProps: {
|
||||||
decimalPlaces: 3
|
decimalPlaces: 3
|
||||||
}
|
}
|
||||||
|
|
@ -129,6 +142,7 @@ const getOverridesFields = (getData, currency, auxElements) => {
|
||||||
doubleHeader: 'Cash-in only',
|
doubleHeader: 'Cash-in only',
|
||||||
textAlign: 'right',
|
textAlign: 'right',
|
||||||
suffix: currency,
|
suffix: currency,
|
||||||
|
textStyle: boldStyle,
|
||||||
inputProps: {
|
inputProps: {
|
||||||
decimalPlaces: 2
|
decimalPlaces: 2
|
||||||
}
|
}
|
||||||
|
|
@ -141,6 +155,7 @@ const getOverridesFields = (getData, currency, auxElements) => {
|
||||||
doubleHeader: 'Cash-in only',
|
doubleHeader: 'Cash-in only',
|
||||||
textAlign: 'right',
|
textAlign: 'right',
|
||||||
suffix: currency,
|
suffix: currency,
|
||||||
|
textStyle: boldStyle,
|
||||||
inputProps: {
|
inputProps: {
|
||||||
decimalPlaces: 2
|
decimalPlaces: 2
|
||||||
}
|
}
|
||||||
|
|
@ -158,6 +173,7 @@ const mainFields = currency => [
|
||||||
editingAlign: 'right',
|
editingAlign: 'right',
|
||||||
input: NumberInput,
|
input: NumberInput,
|
||||||
suffix: '%',
|
suffix: '%',
|
||||||
|
textStyle: boldStyle,
|
||||||
inputProps: {
|
inputProps: {
|
||||||
decimalPlaces: 3
|
decimalPlaces: 3
|
||||||
}
|
}
|
||||||
|
|
@ -171,6 +187,7 @@ const mainFields = currency => [
|
||||||
editingAlign: 'right',
|
editingAlign: 'right',
|
||||||
input: NumberInput,
|
input: NumberInput,
|
||||||
suffix: '%',
|
suffix: '%',
|
||||||
|
textStyle: boldStyle,
|
||||||
inputProps: {
|
inputProps: {
|
||||||
decimalPlaces: 3
|
decimalPlaces: 3
|
||||||
}
|
}
|
||||||
|
|
@ -185,6 +202,7 @@ const mainFields = currency => [
|
||||||
editingAlign: 'right',
|
editingAlign: 'right',
|
||||||
input: NumberInput,
|
input: NumberInput,
|
||||||
suffix: currency,
|
suffix: currency,
|
||||||
|
textStyle: boldStyle,
|
||||||
inputProps: {
|
inputProps: {
|
||||||
decimalPlaces: 2
|
decimalPlaces: 2
|
||||||
}
|
}
|
||||||
|
|
@ -199,6 +217,7 @@ const mainFields = currency => [
|
||||||
editingAlign: 'right',
|
editingAlign: 'right',
|
||||||
input: NumberInput,
|
input: NumberInput,
|
||||||
suffix: currency,
|
suffix: currency,
|
||||||
|
textStyle: boldStyle,
|
||||||
inputProps: {
|
inputProps: {
|
||||||
decimalPlaces: 2
|
decimalPlaces: 2
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue