Develop Updates (#44)

* removed justified alignment from list items

* removed Google Docs underline on hyperlinks
This commit is contained in:
William Grant 2021-09-30 13:37:33 +10:00 committed by GitHub
parent fdf209c265
commit 2c08eaad33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 2 deletions

View File

@ -51,6 +51,16 @@ export function RichBody(props: Props): ReactElement {
node.data.uri.indexOf('://oxen.io') >= 0 node.data.uri.indexOf('://oxen.io') >= 0
? node.data.uri.split('://oxen.io')[1] ? node.data.uri.split('://oxen.io')[1]
: node.data.uri; : node.data.uri;
// Remove Google Docs styling
const renderChildren = Children.map(children, (child: any) => {
if (child.type === 'span' && child.props.className === 'underline') {
const newProps = {
...child.props,
className: undefined,
};
return cloneElement(child, newProps);
}
});
return ( return (
<Link href={url} scroll={!isLocal(node.data.uri)}> <Link href={url} scroll={!isLocal(node.data.uri)}>
<a <a
@ -63,7 +73,7 @@ export function RichBody(props: Props): ReactElement {
} }
rel="noreferrer" rel="noreferrer"
> >
{children} {renderChildren}
</a> </a>
</Link> </Link>
); );
@ -166,7 +176,7 @@ export function RichBody(props: Props): ReactElement {
if (child.type === 'p') { if (child.type === 'p') {
const newProps = { const newProps = {
...child.props, ...child.props,
className: 'mb-3 font-sans tracking-wide text-justify', className: 'mb-3 font-sans tracking-wide',
}; };
return cloneElement(child, newProps); return cloneElement(child, newProps);
} }