-
-
Notifications
You must be signed in to change notification settings - Fork 657
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The type `NavigationNavigateAction` we use is too specific and not the correct one. We want the `NavigationAction` type instead. Also, to make it simpler and consistent, we rename our own type `NavigateAction` to `NavigationAction`.
- Loading branch information
1 parent
2a5f542
commit f6f6375
Showing
2 changed files
with
37 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,102 @@ | ||
/* @flow */ | ||
import { NavigationActions } from 'react-navigation'; | ||
|
||
import type { NavigateAction, Message, Narrow, ApiServerSettings } from '../types'; | ||
import type { NavigationAction, Message, Narrow, ApiServerSettings } from '../types'; | ||
|
||
export const navigateBack = (): NavigateAction => NavigationActions.back(); | ||
export const navigateBack = (): NavigationAction => NavigationActions.back(); | ||
|
||
export const navigateToChat = (narrow: Narrow): NavigateAction => | ||
export const navigateToChat = (narrow: Narrow): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'chat', params: { narrow } }); | ||
|
||
export const navigateToAllStreams = (): NavigateAction => | ||
export const navigateToAllStreams = (): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'subscriptions' }); | ||
|
||
export const navigateToUsersScreen = (): NavigateAction => | ||
export const navigateToUsersScreen = (): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'users' }); | ||
|
||
export const navigateToSearch = (): NavigateAction => | ||
export const navigateToSearch = (): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'search' }); | ||
|
||
export const navigateToSettings = (): NavigateAction => | ||
export const navigateToSettings = (): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'settings' }); | ||
|
||
export const navigateToEmojiPicker = (messageId: number): NavigateAction => | ||
export const navigateToEmojiPicker = (messageId: number): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'emoji-picker', params: { messageId } }); | ||
|
||
export const navigateToAuth = (serverSettings: ApiServerSettings): NavigateAction => | ||
export const navigateToAuth = (serverSettings: ApiServerSettings): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'auth', params: { serverSettings } }); | ||
|
||
export const navigateToDev = (): NavigateAction => NavigationActions.navigate({ routeName: 'dev' }); | ||
export const navigateToDev = (): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'dev' }); | ||
|
||
export const navigateToPassword = (requireEmailFormat: boolean): NavigateAction => | ||
export const navigateToPassword = (requireEmailFormat: boolean): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'password', params: { requireEmailFormat } }); | ||
|
||
export const navigateToAccountPicker = (): NavigateAction => | ||
export const navigateToAccountPicker = (): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'account' }); | ||
|
||
export const navigateToAccountDetails = (email: string): NavigateAction => | ||
export const navigateToAccountDetails = (email: string): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'account-details', params: { email } }); | ||
|
||
export const navigateToGroupDetails = (recipients: string[]): NavigateAction => | ||
export const navigateToGroupDetails = (recipients: string[]): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'group-details', params: { recipients } }); | ||
|
||
export const navigateToAddNewAccount = (realm: string): NavigateAction => | ||
export const navigateToAddNewAccount = (realm: string): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'realm', params: { realm } }); | ||
|
||
export const navigateToLightbox = (src: string, message: Message): NavigateAction => | ||
export const navigateToLightbox = (src: string, message: Message): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'lightbox', params: { src, message } }); | ||
|
||
export const navigateToLoading = (): NavigateAction => | ||
export const navigateToLoading = (): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'loading' }); | ||
|
||
export const navigateToLanguage = (): NavigateAction => | ||
export const navigateToLanguage = (): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'language' }); | ||
|
||
export const navigateToCreateGroup = (): NavigateAction => | ||
export const navigateToCreateGroup = (): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'group' }); | ||
|
||
export const navigateToDiagnostics = (): NavigateAction => | ||
export const navigateToDiagnostics = (): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'diagnostics' }); | ||
|
||
export const navigateToWelcomeHelp = (): NavigateAction => | ||
export const navigateToWelcomeHelp = (): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'welcome-help' }); | ||
|
||
export const navigateToWelcomeScreen = (): NavigateAction => | ||
export const navigateToWelcomeScreen = (): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'welcome' }); | ||
|
||
export const navigateToVariables = (): NavigateAction => | ||
export const navigateToVariables = (): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'variables' }); | ||
|
||
export const navigateToTiming = (): NavigateAction => | ||
export const navigateToTiming = (): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'timing' }); | ||
|
||
export const navigateToStorage = (): NavigateAction => | ||
export const navigateToStorage = (): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'storage' }); | ||
|
||
export const navigateToDebug = (): NavigateAction => | ||
export const navigateToDebug = (): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'debug' }); | ||
|
||
export const navigateToNotifDiag = (): NavigateAction => | ||
export const navigateToNotifDiag = (): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'notifDiag' }); | ||
|
||
export const navigateToStream = (streamId: number): NavigateAction => | ||
export const navigateToStream = (streamId: number): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'stream', params: { streamId } }); | ||
|
||
export const navigateToTopicList = (streamId: number): NavigateAction => | ||
export const navigateToTopicList = (streamId: number): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'topics', params: { streamId } }); | ||
|
||
export const navigateToCreateStream = (): NavigateAction => | ||
export const navigateToCreateStream = (): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'stream-create' }); | ||
|
||
export const navigateToEditStream = (streamId: number): NavigateAction => | ||
export const navigateToEditStream = (streamId: number): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'stream-edit', params: { streamId } }); | ||
|
||
export const navigateToStreamSubscribers = (streamId: number): NavigateAction => | ||
export const navigateToStreamSubscribers = (streamId: number): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'invite-users', params: { streamId } }); | ||
|
||
export const navigateToNotifications = (): NavigateAction => | ||
export const navigateToNotifications = (): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'notifications' }); | ||
|
||
export const navigateToLegal = (): NavigateAction => | ||
export const navigateToLegal = (): NavigationAction => | ||
NavigationActions.navigate({ routeName: 'legal' }); |