Merge branch 'release/next-js' of https://github.com/urbit/urbit into zustand-stores

This commit is contained in:
Tyler Brown Cifu Shuster 2021-03-08 12:03:52 -08:00
commit 4f39a2fd2a
5 changed files with 18 additions and 8 deletions

View File

@ -121,8 +121,8 @@ class App extends React.Component {
faviconString() {
let background = '#ffffff';
if (this.props.contacts.hasOwnProperty('/~/default')) {
background = `#${uxToHex(this.props.contacts['/~/default'][window.ship].color)}`;
if (this.props.contacts.hasOwnProperty(`~${window.ship}`)) {
background = `#${uxToHex(this.props.contacts[`~${window.ship}`].color)}`;
}
const foreground = foregroundFromBackground(background);
const svg = sigiljs({

View File

@ -156,7 +156,8 @@ h2 {
blockquote {
padding: 0 0 0 16px;
margin: 0;
border-left: 1px solid black;
color: inherit;
border-left: 1px solid;
}
:root {
@ -173,6 +174,7 @@ blockquote {
height: 100% !important;
width: 100% !important;
cursor: text;
color: inherit;
background: transparent;
}
@ -308,9 +310,6 @@ pre.CodeMirror-placeholder.CodeMirror-line-like {
/* dark */
@media (prefers-color-scheme: dark) {
blockquote {
border-left: 1px solid inherit;
}
/* codemirror */
.chat .cm-s-tlon.CodeMirror {

View File

@ -27,6 +27,7 @@ export const MarkdownField = ({
width="100%"
display="flex"
flexDirection="column"
color="black"
{...rest}
>
<MarkdownEditor

View File

@ -1,5 +1,5 @@
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';
@ -30,6 +30,14 @@ export function Note(props: NoteProps & RouteComponentProps) {
const { notebook, note, 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];
@ -104,7 +112,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}

View File

@ -41,6 +41,8 @@
cursor: text;
font-size: 12px;
line-height: 20px;
background: inherit;
color: inherit;
}
.publish .CodeMirror * {