chore: improve Collapse、ContactCard jsx segment

This commit is contained in:
陈嘉涵
2019-12-16 12:01:57 +08:00
parent 9c6ae2c28b
commit 1dd0d42b5f
4 changed files with 71 additions and 51 deletions
+12 -6
View File
@@ -30,6 +30,17 @@ function ContactCard(
}
}
function Content() {
if (type === 'add') {
return props.addText || t('addText');
}
return [
<div>{`${t('name')}${props.name}`}</div>,
<div>{`${t('tel')}${props.tel}`}</div>
];
}
return (
<Cell
center
@@ -41,12 +52,7 @@ function ContactCard(
onClick={onClick}
{...inherit(ctx)}
>
{type === 'add'
? props.addText || t('addText')
: [
<div>{`${t('name')}${props.name}`}</div>,
<div>{`${t('tel')}${props.tel}`}</div>
]}
{Content()}
</Cell>
);
}