Skip to content

Commit

Permalink
nav types: Have EditStreamCard call for just navigation methods, not …
Browse files Browse the repository at this point in the history
…prop

Now that we have this AppNavigationMethods type, it better reflects
what EditStreamCard (and its dependency InputRowRadioButtons) really
need from the `navigation` prop they're handed: they need the ability
to invoke methods like `addListener` and `navigate`.
  • Loading branch information
gnprice committed Jun 10, 2022
1 parent 0ba4629 commit 4f0636d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/common/InputRowRadioButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { BRAND_COLOR, createStyleSheet } from '../styles';
import Touchable from './Touchable';
import ZulipTextIntl from './ZulipTextIntl';
import { IconRight } from './Icons';
import type { AppNavigationProp } from '../nav/AppNavigator';
import type { AppNavigationMethods } from '../nav/AppNavigator';

type Item<TKey> = $ReadOnly<{|
key: TKey,
Expand All @@ -33,7 +33,7 @@ type Props<TItemKey> = $ReadOnly<{|
*
* Pass this down from props or `useNavigation`.
*/
navigation: AppNavigationProp<>,
navigation: AppNavigationMethods,

/** What the setting is about, e.g., "Theme". */
label: LocalizableText,
Expand Down
4 changes: 2 additions & 2 deletions src/streams/EditStreamCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
getOwnUserRole,
roleIsAtLeast,
} from '../permissionSelectors';
import type { AppNavigationProp } from '../nav/AppNavigator';
import type { AppNavigationMethods } from '../nav/AppNavigator';
import Input from '../common/Input';
import InputRowRadioButtons from '../common/InputRowRadioButtons';
import ZulipTextIntl from '../common/ZulipTextIntl';
Expand All @@ -22,7 +22,7 @@ import styles from '../styles';
import { TranslationContext } from '../boot/TranslationProvider';

type PropsBase = $ReadOnly<{|
navigation: AppNavigationProp<'edit-stream' | 'create-stream'>,
navigation: AppNavigationMethods,

initialValues: {|
name: string,
Expand Down

0 comments on commit 4f0636d

Please sign in to comment.