This commit is contained in:
Tyler Brown Cifu Shuster 2021-05-10 07:36:07 -07:00
parent 40bc76e8d1
commit 9471ce0815
4 changed files with 11 additions and 8 deletions

View File

@ -424,10 +424,10 @@ export const useHovering = (): useHoveringInterface => {
};
export function withHovering<T>(Component: React.ComponentType<T>) {
const { hovering, bind } = useHovering();
return (props: T) => (
<Component hovering={hovering} {...bind} {...props} />
)
return React.forwardRef((props, ref) => {
const { hovering, bind } = useHovering();
return <Component ref={ref} hovering={hovering} bind={bind} {...props} />
})
}
const DM_REGEX = /ship\/~([a-z]|-)*\/dm--/;

View File

@ -2,6 +2,7 @@ import { Box, Col } from '@tlon/indigo-react';
import { Association, Graph, GraphNode, Group } from '@urbit/api';
import bigInt from 'big-integer';
import React from 'react';
import { withRouter } from 'react-router';
import GlobalApi from '~/logic/api/global';
import { resourceFromPath } from '~/logic/lib/group';
import VirtualScroller from '~/views/components/VirtualScroller';
@ -15,7 +16,7 @@ interface PostFeedProps {
graph: Graph;
graphPath: string;
api: GlobalApi;
history?: History;
history: History;
baseUrl: string;
parentNode?: GraphNode;
grandparentNode?: GraphNode;
@ -25,7 +26,7 @@ interface PostFeedProps {
pendingSize: number;
}
export class PostFeed extends React.Component<PostFeedProps, PostFeedState> {
class PostFeed extends React.Component<PostFeedProps, PostFeedState> {
isFetching: boolean;
constructor(props) {
super(props);
@ -187,3 +188,5 @@ export class PostFeed extends React.Component<PostFeedProps, PostFeedState> {
);
}
}
export default withRouter(PostFeed);

View File

@ -3,7 +3,7 @@ import bigInt from 'big-integer';
import React from 'react';
import { resourceFromPath } from '~/logic/lib/group';
import { Loading } from '~/views/components/Loading';
import { PostFeed } from './PostFeed';
import PostFeed from './PostFeed';
import PostItem from './PostItem/PostItem';
export default function PostReplies(props) {

View File

@ -3,7 +3,7 @@ import { Association, Graph, Group } from '@urbit/api';
import React, { ReactElement } from 'react';
import GlobalApi from '~/logic/api/global';
import { Loading } from '~/views/components/Loading';
import { PostFeed } from './PostFeed';
import PostFeed from './PostFeed';
import PostInput from './PostInput';
interface PostTimelineProps {