Dynamic library sources working; Need to expand and test other providers

This commit is contained in:
James Barnsley
2021-04-22 21:16:21 +12:00
parent c1493f1a3c
commit faf5f53692
10 changed files with 381 additions and 362 deletions

View File

@ -7,40 +7,41 @@ const LinksSentence = memo(({ items, itemType, className, nolinks }) => {
return (
<span className={`${className} links-sentence`}>
{
items.map(({ name, uri, type }, index) => {
if (!name) return <span>-</span>;
items.map(({ name, uri, type }, index) => {
if (!name) return <span>-</span>;
let separator = null;
if (index == items.length - 2) {
separator = ' and ';
} else if (index < items.length - 2) {
separator = ', ';
}
let separator = null;
if (index === items.length - 2) {
separator = ' and ';
} else if (index < items.length - 2) {
separator = ', ';
}
if (!name) {
var content = <span>-</span>;
} else if (!uri || nolinks) {
var content = <span>{name}</span>;
} else {
var content = (
<URILink
className="links-sentence__item links-sentence__item--link"
uri={uri}
type={type || itemType}
>
{name}
</URILink>
);
}
let content = null;
if (!name) {
content = <span>-</span>;
} else if (!uri || nolinks) {
content = <span>{name}</span>;
} else {
content = (
<URILink
className="links-sentence__item links-sentence__item--link"
uri={uri}
type={itemType || type}
>
{name}
</URILink>
);
}
return (
<span key={`index_${uri}`}>
{content}
{separator}
</span>
);
})
}
return (
<span key={`index_${uri}`}>
{content}
{separator}
</span>
);
})
}
</span>
);
});