From f5615c50f638b0a7bda3bb583e94a51ffa8b3d63 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Fri, 2 Dec 2022 13:36:37 -0300 Subject: [PATCH] Export RefreshControl so we don't have to use theme hoc --- app/views/RoomView/List/RefreshControl.tsx | 11 +++++++++++ app/views/RoomView/List/index.tsx | 19 ++++++++----------- app/views/RoomView/index.tsx | 1 - 3 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 app/views/RoomView/List/RefreshControl.tsx diff --git a/app/views/RoomView/List/RefreshControl.tsx b/app/views/RoomView/List/RefreshControl.tsx new file mode 100644 index 000000000..3dfefa1ea --- /dev/null +++ b/app/views/RoomView/List/RefreshControl.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +import { RefreshControl as RefreshControlRN, RefreshControlProps } from 'react-native'; + +import { useTheme } from '../../../theme'; + +type TRefreshControlProps = Pick; + +export const RefreshControl = ({ refreshing, onRefresh }: TRefreshControlProps): React.ReactElement => { + const { colors } = useTheme(); + return ; +}; diff --git a/app/views/RoomView/List/index.tsx b/app/views/RoomView/List/index.tsx index f2028ea5c..b81baf365 100644 --- a/app/views/RoomView/List/index.tsx +++ b/app/views/RoomView/List/index.tsx @@ -2,7 +2,7 @@ import { Q } from '@nozbe/watermelondb'; import { dequal } from 'dequal'; import moment from 'moment'; import React from 'react'; -import { FlatListProps, ViewToken, RefreshControl } from 'react-native'; +import { FlatListProps, ViewToken } from 'react-native'; import { event, Value } from 'react-native-reanimated'; import { Observable, Subscription } from 'rxjs'; @@ -18,9 +18,9 @@ import List, { IListProps, TListRef } from './List'; import NavBottomFAB from './NavBottomFAB'; import { loadMissedMessages, loadThreadMessages } from '../../../lib/methods'; import { Services } from '../../../lib/services'; -import { TSupportedThemes, withTheme } from '../../../theme'; -import { MESSAGE_TYPE_ANY_LOAD, themes } from '../../../lib/constants'; +import { MESSAGE_TYPE_ANY_LOAD } from '../../../lib/constants'; import { TMessage } from '../definitions'; +import { RefreshControl } from './RefreshControl'; const QUERY_SIZE = 50; @@ -50,7 +50,6 @@ export interface IListContainerProps { navigation: any; // TODO: type me showMessageInMainThread: boolean; serverVersion: string | null; - theme?: TSupportedThemes; } interface IListContainerState { @@ -339,8 +338,8 @@ class ListContainer extends React.Component @@ -349,7 +348,7 @@ class ListContainer extends React.Component - } + refreshControl={} /> @@ -370,4 +367,4 @@ class ListContainer extends React.Component {