From a3fab39d6d36bffca154c61be0934b09b2f8507d Mon Sep 17 00:00:00 2001 From: Wesley Aptekar-Cassels Date: Thu, 8 Apr 2021 14:51:16 +0800 Subject: [PATCH] TopicList [nfc]: Pass stream name into TopicItem This will be required for actionsheets to work properly. --- src/topics/TopicList.js | 6 ++++-- src/topics/TopicListScreen.js | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/topics/TopicList.js b/src/topics/TopicList.js index 36bb480f5e2..733610da13d 100644 --- a/src/topics/TopicList.js +++ b/src/topics/TopicList.js @@ -2,7 +2,7 @@ import React, { PureComponent } from 'react'; import { FlatList } from 'react-native'; -import type { TopicExtended } from '../types'; +import type { Stream, TopicExtended } from '../types'; import { createStyleSheet } from '../styles'; import TopicItem from '../streams/TopicItem'; import { LoadingIndicator, SearchEmptyState } from '../common'; @@ -15,13 +15,14 @@ const styles = createStyleSheet({ }); type Props = $ReadOnly<{| + stream: Stream, topics: ?(TopicExtended[]), onPress: (stream: string, topic: string) => void, |}>; export default class TopicList extends PureComponent { render() { - const { topics, onPress } = this.props; + const { stream, topics, onPress } = this.props; if (!topics) { return ; @@ -40,6 +41,7 @@ export default class TopicList extends PureComponent { renderItem={({ item }) => ( { handleFilterChange = (filter: string) => this.setState({ filter }); render() { - const { topics } = this.props; + const { stream, topics } = this.props; const { filter } = this.state; const filteredTopics = topics && topics.filter(topic => topic.name.toLowerCase().includes(filter.toLowerCase())); return ( - + ); }