publish: fix link color
Fixes urbit/landscape#521
import React, { useState, useEffect } from 'react';
-import { Box, Text, Col } from '@tlon/indigo-react';
+import { Box, Text, Col, Anchor } from '@tlon/indigo-react';
import ReactMarkdown from 'react-markdown';
import bigInt from 'big-integer';
@@ -32,6 +32,14 @@ export function Note(props: NoteProps & RouteComponentProps) {
const { notebook, note, contacts, ship, book, api, rootUrl, baseUrl, group } = props;
const editCommentId = props.match.params.commentId;
+ const renderers = {
+ link: ({ href, children }) => {
+ return (
+ <Anchor display="inline" target="_blank" href={href}>{children}</Anchor>
+ )
+ }
+ };
+
const deletePost = async () => {
setDeleting(true);
const indices = [note.post.index];
@@ -107,7 +115,7 @@ export function Note(props: NoteProps & RouteComponentProps) {
</Box>
</Col>
<Box color="black" className="md" style={{ overflowWrap: 'break-word', overflow: 'hidden' }}>
- <ReactMarkdown source={body} linkTarget={'_blank'} />
+ <ReactMarkdown source={body} linkTarget={'_blank'} renderers={renderers} />
</Box>
<NoteNavigation
notebook={notebook}
