mirror of
https://github.com/urbit/shrub.git
synced 2024-12-11 11:02:25 +03:00
collections: address L review
This commit is contained in:
parent
5f7e4c34b2
commit
8bfbef1b45
@ -100,9 +100,6 @@ class RemoteContent extends Component<RemoteContentProps, RemoteContentState> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
}
|
|
||||||
|
|
||||||
onLoad = () => {
|
onLoad = () => {
|
||||||
window.requestAnimationFrame(() => {
|
window.requestAnimationFrame(() => {
|
||||||
const { restore } = this;
|
const { restore } = this;
|
||||||
@ -257,35 +254,37 @@ return;
|
|||||||
if (!this.state.embed || this.state.embed?.html === '') {
|
if (!this.state.embed || this.state.embed?.html === '') {
|
||||||
this.loadOembed();
|
this.loadOembed();
|
||||||
}
|
}
|
||||||
const renderEmbed = !(this.state.embed !== 'error' && this.state.embed?.html);
|
const renderEmbed = !(this.state.embed !== 'error' && this.state.embed?.html);
|
||||||
const embed = <Box
|
const embed = (
|
||||||
mb={2}
|
<Box
|
||||||
width='100%'
|
mb={2}
|
||||||
flexShrink={0}
|
width='100%'
|
||||||
display={this.state.unfold ? 'block' : 'none'}
|
flexShrink={0}
|
||||||
className='embed-container'
|
display={this.state.unfold ? 'block' : 'none'}
|
||||||
style={style}
|
className='embed-container'
|
||||||
onLoad={this.onLoad}
|
style={style}
|
||||||
{...oembedProps}
|
onLoad={this.onLoad}
|
||||||
{...props}
|
{...oembedProps}
|
||||||
>
|
{...props}
|
||||||
<TruncatedText
|
>
|
||||||
display={(renderUrl && this.state.embed?.title && this.state.embed.title !== url) ? 'inline-block' : 'none'}
|
<TruncatedText
|
||||||
fontWeight='bold' width='100%'
|
display={(renderUrl && this.state.embed?.title && this.state.embed.title !== url) ? 'inline-block' : 'none'}
|
||||||
>
|
fontWeight='bold' width='100%'
|
||||||
{this.state.embed?.title}
|
>
|
||||||
</TruncatedText>
|
{this.state.embed?.title}
|
||||||
{this.state.embed && this.state.embed.html && this.state.unfold
|
</TruncatedText>
|
||||||
? <EmbedContainer markup={this.state.embed.html}>
|
{this.state.embed && this.state.embed.html && this.state.unfold
|
||||||
<div className="embed-container" ref={(el) => {
|
? <EmbedContainer markup={this.state.embed.html}>
|
||||||
this.onLoad();
|
<div className="embed-container" ref={(el) => {
|
||||||
this.containerRef = el;
|
this.onLoad();
|
||||||
}}
|
this.containerRef = el;
|
||||||
dangerouslySetInnerHTML={{ __html: this.state.embed.html }}
|
}}
|
||||||
></div>
|
dangerouslySetInnerHTML={{ __html: this.state.embed.html }}
|
||||||
</EmbedContainer>
|
></div>
|
||||||
: null}
|
</EmbedContainer>
|
||||||
</Box>;
|
: null}
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { ChangeEvent, useCallback, useMemo, useState } from 'react';
|
import React, { ChangeEvent, useCallback, useMemo } from 'react';
|
||||||
|
|
||||||
import { Text, Box, BaseInput, BaseInputProps } from '@tlon/indigo-react';
|
import { Text, Box, BaseInput } from '@tlon/indigo-react';
|
||||||
import { PropFunc } from '~/types';
|
import { PropFunc } from '~/types';
|
||||||
|
|
||||||
type StatelessUrlInputProps = PropFunc<typeof BaseInput> & {
|
type StatelessUrlInputProps = PropFunc<typeof BaseInput> & {
|
||||||
@ -17,7 +17,6 @@ type StatelessUrlInputProps = PropFunc<typeof BaseInput> & {
|
|||||||
export function StatelessUrlInput(props: StatelessUrlInputProps) {
|
export function StatelessUrlInput(props: StatelessUrlInputProps) {
|
||||||
const {
|
const {
|
||||||
value,
|
value,
|
||||||
error,
|
|
||||||
focussed,
|
focussed,
|
||||||
disabled,
|
disabled,
|
||||||
onChange = () => {},
|
onChange = () => {},
|
||||||
@ -27,8 +26,6 @@ export function StatelessUrlInput(props: StatelessUrlInputProps) {
|
|||||||
...rest
|
...rest
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
console.log(focussed);
|
|
||||||
|
|
||||||
const placeholder = useMemo(
|
const placeholder = useMemo(
|
||||||
() => (
|
() => (
|
||||||
<Text
|
<Text
|
||||||
|
Loading…
Reference in New Issue
Block a user