Merge pull request #4586 from urbit/mp/landscape/misc-warnings

landscape: clean up console crashes, key mapped components
This commit is contained in:
matildepark 2021-03-11 20:25:11 -05:00 committed by GitHub
commit f20da46745
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 10 deletions

View File

@ -408,6 +408,7 @@ export const Message = ({
case 'text':
return (
<TextContent
key={i}
api={api}
fontSize={1}
lineHeight={'20px'}
@ -415,10 +416,11 @@ export const Message = ({
/>
);
case 'code':
return <CodeContent content={content} />;
return <CodeContent key={i} content={content} />;
case 'url':
return (
<Box
key={i}
flexShrink={0}
fontSize={1}
lineHeight='20px'
@ -455,6 +457,7 @@ export const Message = ({
const first = (i) => (i === 0);
return (
<Mention
key={i}
first={first(i)}
group={group}
scrollWindow={scrollWindow}

View File

@ -91,7 +91,7 @@ const MessageMarkdown = React.memo((props) => {
}, []);
return lines.map((line, i) => (
<>
<React.Fragment key={i}>
{i !== 0 && <Row height={2} />}
<ReactMarkdown
{...rest}
@ -123,7 +123,7 @@ const MessageMarkdown = React.memo((props) => {
]
]}
/>
</>
</React.Fragment>
));
});

View File

@ -40,7 +40,7 @@ interface VirtualScrollerProps<T> {
data: BigIntOrderedMap<T>;
/**
* The component to render the items
*
*
* @remarks
*
* This component must be referentially stable, so either use `useCallback` or
@ -157,7 +157,7 @@ export default class VirtualScroller<T> extends Component<VirtualScrollerProps<T
this.loaded.top = true;
this.loaded.bottom = true;
}
this.updateVisible(0);
this.resetScroll();
this.loadRows(false);
@ -493,7 +493,7 @@ export default class VirtualScroller<T> extends Component<VirtualScrollerProps<T
<>
{!IS_IOS && (<Box borderRadius="3" top ={isTop ? "0" : undefined} bottom={!isTop ? "0" : undefined} ref={el => { this.scrollRef = el; }} right="0" height="50px" position="absolute" width="4px" backgroundColor="lightGray" />)}
<ScrollbarLessBox overflowY='scroll' ref={this.setWindow} onScroll={this.onScroll} style={{ ...style, ...{ transform }, "-webkit-overflow-scrolling": "auto" }}>
<ScrollbarLessBox overflowY='scroll' ref={this.setWindow} onScroll={this.onScroll} style={{ ...style, ...{ transform }, "WebkitOverflowScrolling": "auto" }}>
<Box style={{ transform, width: 'calc(100% - 4px)' }}>
{(isTop ? !atStart : !atEnd) && (<Center height="5">
<LoadingSpinner />

View File

@ -10,16 +10,14 @@
font-family: 'Inter';
font-style: normal;
font-weight: 500;
src: url("/~landscape/fonts/inter-medium.woff2") format("woff2"),
url("https://media.urbit.org/fonts/Inter-Medium.woff2") format("woff2");
src: url("https://media.urbit.org/fonts/Inter-Medium.woff2") format("woff2");
}
@font-face {
font-family: 'Inter';
font-style: normal;
font-weight: 600;
src: url("/~landscape/fonts/inter-semibold.woff2") format("woff2"),
url("https://media.urbit.org/fonts/Inter-SemiBold.woff2") format("woff2");
src: url("https://media.urbit.org/fonts/Inter-SemiBold.woff2") format("woff2");
}
@font-face {