fix: wrong fonts on the operator info pages (#430)

* fix: fix bug when loading the contact info page with no phone configured
or no country configured in locales

style: fixed contact info styles

style: fixes on the terms & conditions styles

* fix: re-add H4 style after merge

fix: code styling
This commit is contained in:
Liordino Neto 2020-09-22 18:28:12 -03:00 committed by GitHub
parent 3c0f4ec194
commit 02474a0a6d
4 changed files with 41 additions and 32 deletions

View file

@ -24,8 +24,8 @@ export default {
alignItems: 'center', alignItems: 'center',
justifyContent: 'end' justifyContent: 'end'
}, },
billInput:{ billInput: {
width:'100%' width: '100%'
}, },
suffix: { suffix: {
paddingLeft: spacer * 2 paddingLeft: spacer * 2

View file

@ -13,14 +13,7 @@ import PromptWhenDirty from 'src/components/PromptWhenDirty'
import { Link } from 'src/components/buttons' import { Link } from 'src/components/buttons'
import Switch from 'src/components/inputs/base/Switch' import Switch from 'src/components/inputs/base/Switch'
import { TextInput, NumberInput } from 'src/components/inputs/formik' import { TextInput, NumberInput } from 'src/components/inputs/formik'
import { import { P, H4, Info3, Label1, Label2, Label3 } from 'src/components/typography'
P,
Info2,
Info3,
Label1,
Label2,
Label3
} from 'src/components/typography'
import { ReactComponent as EditIcon } from 'src/styling/icons/action/edit/enabled.svg' import { ReactComponent as EditIcon } from 'src/styling/icons/action/edit/enabled.svg'
import { ReactComponent as WarningIcon } from 'src/styling/icons/warning-icon/comet.svg' import { ReactComponent as WarningIcon } from 'src/styling/icons/warning-icon/comet.svg'
import { fontSize5 } from 'src/styling/variables' import { fontSize5 } from 'src/styling/variables'
@ -174,7 +167,7 @@ const ContactInfo = () => {
locale.country locale.country
).formatInternational() ).formatInternational()
: '', : '',
component: TextInput component: NumberInput
}, },
{ {
name: 'email', name: 'email',
@ -214,26 +207,26 @@ const ContactInfo = () => {
return ( return (
<> <>
<div className={classes.header}> <div className={classes.rowWrapper}>
<Info2>Contact information</Info2> <H4>Contact information</H4>
</div>
<div className={classes.rowWrapper}>
<P>Info card enabled?</P>
<div className={classes.switch}>
<Switch
checked={info.active}
onChange={event =>
save({
active: event.target.checked
})
}
/>
<Label2>{info.active ? 'Yes' : 'No'}</Label2>
</div>
</div> </div>
<div className={classes.section}> <div className={classes.section}>
<div className={classes.switchRow}> <div className={classes.rowWrapper}>
<P>Info card enabled?</P> <H4>Info card</H4>
<div className={classes.switch}>
<Switch
checked={info.active}
onChange={event =>
save({
active: event.target.checked
})
}
/>
<Label2>{info.active ? 'Yes' : 'No'}</Label2>
</div>
</div>
<div className={classes.header}>
<Info2>Info card</Info2>
{!editing && ( {!editing && (
<div className={classes.transparentButton}> <div className={classes.transparentButton}>
<button onClick={() => setEditing(true)}> <button onClick={() => setEditing(true)}>

View file

@ -77,6 +77,22 @@ const contactInfoStyles = {
display: 'flex', display: 'flex',
flexDirection: 'row', flexDirection: 'row',
paddingLeft: 4 paddingLeft: 4
},
rowWrapper: {
display: 'flex',
alignItems: 'center',
position: 'relative',
flex: 'wrap'
},
transparentButton: {
'& > *': {
margin: 'auto 12px'
},
'& button': {
border: 'none',
backgroundColor: 'transparent',
cursor: 'pointer'
}
} }
} }

View file

@ -12,7 +12,7 @@ import PromptWhenDirty from 'src/components/PromptWhenDirty'
import { Link } from 'src/components/buttons' import { Link } from 'src/components/buttons'
import { Switch } from 'src/components/inputs' import { Switch } from 'src/components/inputs'
import { TextInput } from 'src/components/inputs/formik' import { TextInput } from 'src/components/inputs/formik'
import { Info2, Info3, Label2, Label3 } from 'src/components/typography' import { H4, Info2, Info3, Label2, Label3 } from 'src/components/typography'
import { ReactComponent as EditIcon } from 'src/styling/icons/action/edit/enabled.svg' import { ReactComponent as EditIcon } from 'src/styling/icons/action/edit/enabled.svg'
import { fromNamespace, toNamespace, namespaces } from 'src/utils/config' import { fromNamespace, toNamespace, namespaces } from 'src/utils/config'
@ -191,8 +191,8 @@ const TermsConditions = () => {
return ( return (
<> <>
<div className={classes.header}> <div className={classes.rowWrapper}>
<Info2>Terms &amp; Conditions</Info2> <H4>Terms &amp; Conditions</H4>
</div> </div>
<div className={classes.section}> <div className={classes.section}>
<div className={classes.enable}> <div className={classes.enable}>