Browse Source

Merge branch 'chore-fix' into 'master'

Chore fix

See merge request jetup/rws/rws-appication!355
merge-requests/356/head
Coder 2 years ago
parent
commit
bb56249232
  1. 10
      src/modules/account/atoms/account-title.atom.tsx
  2. 2
      src/modules/comments/transforms/comments.transforms.ts
  3. 4
      src/modules/contacts/hooks/use-contact-detail.hook.ts
  4. 8
      src/modules/contacts/screens/contact-detail.screen.tsx
  5. 2
      src/shared/components/forms/form-large-control-with-icon.component.tsx
  6. 2
      src/shared/helpers/name.helpers.ts

10
src/modules/account/atoms/account-title.atom.tsx

@ -15,14 +15,16 @@ interface IAccountTitleAtomProps { @@ -15,14 +15,16 @@ interface IAccountTitleAtomProps {
export const AccountTitleAtom = (props: IAccountTitleAtomProps) => {
const { styles } = useTheme(createStyles)
const getSubText = () => {
if (props.myFactoryName)
return `${props.myFactoryName}, ${props.position}`
else return props.position
if (props.myFactoryName) {
if (props.position)
return `${props.myFactoryName}, ${props.position}`
return props.myFactoryName
} else return props.position ? props.position : ''
}
return (
<View style={styles.titleWrap}>
<Txt style={styles.title}>
{`${props.firstName} ${props.lastName}`}
{`${props.firstName || ''} ${props.lastName || ''}`}
</Txt>
<Txt style={styles.description}>{getSubText()}</Txt>
</View>

2
src/modules/comments/transforms/comments.transforms.ts

@ -33,5 +33,5 @@ export const transformComments = ( @@ -33,5 +33,5 @@ export const transformComments = (
comments: ICommentFullInfo[],
accountId: number,
) => {
return comments.map(it => transformComment(it, accountId))
return comments.filter(comment => _.isString(comment.content)).map(it => transformComment(it, accountId))
}

4
src/modules/contacts/hooks/use-contact-detail.hook.ts

@ -35,9 +35,9 @@ export const useContactDetail = (id: number) => { @@ -35,9 +35,9 @@ export const useContactDetail = (id: number) => {
if (contactDetail) {
const { info: contactDetailInfo } = contactDetail
const dateToRender = moment(contactDetailInfo?.dateOfBirth).format(
const dateToRender = contactDetailInfo?.dateOfBirth ? moment(contactDetailInfo?.dateOfBirth).format(
'DD MMMM',
)
) : ''
return {
userId: contactDetailInfo?.userId,

8
src/modules/contacts/screens/contact-detail.screen.tsx

@ -53,9 +53,11 @@ export const ContactDetailScreen: FC<IProps> = ({ navigation, route }) => { @@ -53,9 +53,11 @@ export const ContactDetailScreen: FC<IProps> = ({ navigation, route }) => {
}
const getSubText = () => {
if (contact?.factoryName)
return `${contact.factoryName}, ${contact.position}`
else return contact?.position
if (contact?.factoryName) {
if (contact.position)
return `${contact.factoryName}, ${contact.position}`
return contact.factoryName
} else return contact?.position ? contact.position : ''
}
const fieldsToRender = useMemo(

2
src/shared/components/forms/form-large-control-with-icon.component.tsx

@ -134,7 +134,7 @@ const createStyles = (theme: PartialTheme) => @@ -134,7 +134,7 @@ const createStyles = (theme: PartialTheme) =>
height: $size(50, 46),
flex: 1,
fontSize: $size(16, 14),
lineHeight: $size(20, 18),
// lineHeight: $size(20, 18),
color: theme.input.$text,
},
icon: {

2
src/shared/helpers/name.helpers.ts

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
export const createFullName = (firstName: string, lastName: string) => {
return `${firstName} ${lastName}`
return [firstName, lastName].filter(it => it).join(' ')
}

Loading…
Cancel
Save