diff --git a/native/chat/sidebar-list-modal.react.js b/native/chat/sidebar-list-modal.react.js
index 08be3527c..f55b6d437 100644
--- a/native/chat/sidebar-list-modal.react.js
+++ b/native/chat/sidebar-list-modal.react.js
@@ -1,145 +1,144 @@
// @flow
import * as React from 'react';
import { View } from 'react-native';
import { useSearchSidebars } from 'lib/hooks/search-threads';
import type { ThreadInfo, SidebarInfo } from 'lib/types/thread-types';
import ExtendedArrow from '../components/arrow-extended.react';
import Arrow from '../components/arrow.react';
import Button from '../components/button.react';
import type { RootNavigationProp } from '../navigation/root-navigator.react';
import type { NavigationRoute } from '../navigation/route-names';
import { useColors, useStyles } from '../themes/colors';
import { SidebarItem } from './sidebar-item.react';
import ThreadListModal from './thread-list-modal.react';
export type SidebarListModalParams = {
+threadInfo: ThreadInfo,
};
type Props = {
+navigation: RootNavigationProp<'SidebarListModal'>,
+route: NavigationRoute<'SidebarListModal'>,
};
function SidebarListModal(props: Props): React.Node {
const {
listData,
searchState,
setSearchState,
onChangeSearchInputText,
} = useSearchSidebars(props.route.params.threadInfo);
const numOfSidebarsWithExtendedArrow = listData.length - 1;
const createRenderItem = React.useCallback(
(
onPressItem: (threadInfo: ThreadInfo) => void,
// eslint-disable-next-line react/display-name
) => (row: { +item: SidebarInfo, +index: number, ... }) => {
let extendArrow: boolean = false;
if (row.index < numOfSidebarsWithExtendedArrow) {
extendArrow = true;
}
return (
);
},
[numOfSidebarsWithExtendedArrow],
);
return (
);
}
function Item(props: {
item: SidebarInfo,
onPressItem: (threadInfo: ThreadInfo) => void,
extendArrow: boolean,
}): React.Node {
const { item, onPressItem, extendArrow } = props;
const { threadInfo } = item;
const onPressButton = React.useCallback(() => onPressItem(threadInfo), [
onPressItem,
threadInfo,
]);
const colors = useColors();
const styles = useStyles(unboundStyles);
let arrow;
if (extendArrow) {
arrow = (
);
} else {
arrow = (
);
}
return (
);
}
const unboundStyles = {
arrow: {
position: 'absolute',
top: -12,
},
extendedArrow: {
position: 'absolute',
top: -6,
},
sidebar: {
- backgroundColor: 'listBackground',
paddingLeft: 0,
paddingRight: 5,
},
sidebarItemContainer: {
flex: 1,
},
sidebarRowContainer: {
flex: 1,
flexDirection: 'row',
},
spacer: {
width: 30,
},
};
export default SidebarListModal;
diff --git a/native/chat/subchannels-list-modal.react.js b/native/chat/subchannels-list-modal.react.js
index 6b8871247..8dc3f4b64 100644
--- a/native/chat/subchannels-list-modal.react.js
+++ b/native/chat/subchannels-list-modal.react.js
@@ -1,100 +1,99 @@
// @flow
import * as React from 'react';
import { View } from 'react-native';
import { useSearchSubchannels } from 'lib/hooks/search-threads';
import type { ChatThreadItem } from 'lib/selectors/chat-selectors';
import { type ThreadInfo } from 'lib/types/thread-types';
import Button from '../components/button.react';
import type { RootNavigationProp } from '../navigation/root-navigator.react';
import type { NavigationRoute } from '../navigation/route-names';
import { useColors, useStyles } from '../themes/colors';
import SubchannelItem from './subchannel-item.react';
import ThreadListModal from './thread-list-modal.react';
export type SubchannelListModalParams = {
+threadInfo: ThreadInfo,
};
type Props = {
+navigation: RootNavigationProp<'SubchannelsListModal'>,
+route: NavigationRoute<'SubchannelsListModal'>,
};
function SubchannelListModal(props: Props): React.Node {
const {
listData,
searchState,
setSearchState,
onChangeSearchInputText,
} = useSearchSubchannels(props.route.params.threadInfo);
return (
);
}
const createRenderItem = (
onPressItem: (threadInfo: ThreadInfo) => void,
// eslint-disable-next-line react/display-name
) => (row: { +item: ChatThreadItem, +index: number, ... }) => {
return ;
};
function Item(props: {
onPressItem: (threadInfo: ThreadInfo) => void,
subchannelInfo: ChatThreadItem,
}): React.Node {
const { onPressItem, subchannelInfo } = props;
const { threadInfo } = subchannelInfo;
const onPressButton = React.useCallback(() => onPressItem(threadInfo), [
onPressItem,
threadInfo,
]);
const colors = useColors();
const styles = useStyles(unboundStyles);
return (
);
}
const unboundStyles = {
subchannel: {
- backgroundColor: 'listBackground',
paddingLeft: 0,
paddingRight: 5,
},
subchannelItemContainer: {
flex: 1,
},
subchannelRowContainer: {
flex: 1,
flexDirection: 'row',
},
};
export default SubchannelListModal;