Adapt account fields rendering code in the WebUI to match upstream

This commit is contained in:
Thibaut Girka 2018-05-09 23:29:14 +02:00
parent 30bb530c70
commit 2f01935cba

View file

@ -102,35 +102,25 @@ export default class Header extends ImmutablePureComponent {
<div className='account__header__content' dangerouslySetInnerHTML={{ __html: emojify(text) }} /> <div className='account__header__content' dangerouslySetInnerHTML={{ __html: emojify(text) }} />
{fields.size > 0 && ( {fields.size > 0 && (
<table className='account__header__fields'> <div className='account__header__fields'>
<tbody> {fields.map((pair, i) => (
{fields.map((pair, i) => ( <dl key={i}>
<tr key={i}> <dt dangerouslySetInnerHTML={{ __html: pair.get('name_emojified') }} title={pair.get('name')} />
<th dangerouslySetInnerHTML={{ __html: pair.get('name_emojified') }} /> <dd dangerouslySetInnerHTML={{ __html: pair.get('value_emojified') }} title={pair.get('value')} />
<td dangerouslySetInnerHTML={{ __html: pair.get('value_emojified') }} /> </dl>
</tr> ))}
))} </div>
</tbody>
</table>
)} )}
{fields.size == 0 && metadata.length && ( {fields.size == 0 && metadata.length && (
<table className='account__header__fields'> <div className='account__header__fields'>
<tbody> {metadata.map((pair, i) => (
{(() => { <dl key={i}>
let data = []; <dt dangerouslySetInnerHTML={{ __html: emojify(pair[0]) }} title={pair[0]} />
for (let i = 0; i < metadata.length; i++) { <dd dangerouslySetInnerHTML={{ __html: emojify(pair[1]) }} title={pair[1]} />
data.push( </dl>
<tr key={i}> ))}
<th scope='row'><div dangerouslySetInnerHTML={{ __html: emojify(metadata[i][0]) }} /></th> </div>
<td><div dangerouslySetInnerHTML={{ __html: emojify(metadata[i][1]) }} /></td>
</tr>
);
}
return data;
})()}
</tbody>
</table>
) || null} ) || null}
{info} {info}