From 8bfbef1b45e108dad8d59b0c05579b18eaa7413d Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Tue, 15 Jun 2021 09:48:57 +1000 Subject: [PATCH] collections: address L review --- .../views/components/RemoteContent/index.tsx | 63 +++++++++---------- .../views/components/StatelessUrlInput.tsx | 7 +-- 2 files changed, 33 insertions(+), 37 deletions(-) diff --git a/pkg/interface/src/views/components/RemoteContent/index.tsx b/pkg/interface/src/views/components/RemoteContent/index.tsx index f3dc855ca8..790f0f0275 100644 --- a/pkg/interface/src/views/components/RemoteContent/index.tsx +++ b/pkg/interface/src/views/components/RemoteContent/index.tsx @@ -100,9 +100,6 @@ class RemoteContent extends Component { } } - componentDidMount() { - } - onLoad = () => { window.requestAnimationFrame(() => { const { restore } = this; @@ -257,35 +254,37 @@ return; if (!this.state.embed || this.state.embed?.html === '') { this.loadOembed(); } - const renderEmbed = !(this.state.embed !== 'error' && this.state.embed?.html); - const embed = - - {this.state.embed?.title} - - {this.state.embed && this.state.embed.html && this.state.unfold - ? -
{ - this.onLoad(); - this.containerRef = el; - }} - dangerouslySetInnerHTML={{ __html: this.state.embed.html }} - >
-
- : null} -
; + const renderEmbed = !(this.state.embed !== 'error' && this.state.embed?.html); + const embed = ( + + + {this.state.embed?.title} + + {this.state.embed && this.state.embed.html && this.state.unfold + ? +
{ + this.onLoad(); + this.containerRef = el; + }} + dangerouslySetInnerHTML={{ __html: this.state.embed.html }} + >
+
+ : null} +
+ ); return ( diff --git a/pkg/interface/src/views/components/StatelessUrlInput.tsx b/pkg/interface/src/views/components/StatelessUrlInput.tsx index 946dd1d366..562b8594bd 100644 --- a/pkg/interface/src/views/components/StatelessUrlInput.tsx +++ b/pkg/interface/src/views/components/StatelessUrlInput.tsx @@ -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'; type StatelessUrlInputProps = PropFunc & { @@ -17,7 +17,6 @@ type StatelessUrlInputProps = PropFunc & { export function StatelessUrlInput(props: StatelessUrlInputProps) { const { value, - error, focussed, disabled, onChange = () => {}, @@ -27,8 +26,6 @@ export function StatelessUrlInput(props: StatelessUrlInputProps) { ...rest } = props; - console.log(focussed); - const placeholder = useMemo( () => (