diff --git a/.gitignore b/.gitignore index 879b5110fc..16b64c453d 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,5 @@ api/.env mobile/.expo test-results.json public/uploads +cypress/screenshots/ +cypress/videos/ diff --git a/api/queries/thread/content.js b/api/queries/thread/content.js new file mode 100644 index 0000000000..1d442b57e9 --- /dev/null +++ b/api/queries/thread/content.js @@ -0,0 +1,25 @@ +// @flow +import type { GraphQLContext } from '../../'; +import type { DBThread } from 'shared/types'; + +export default ({ content }: DBThread, _: any, ctx: GraphQLContext) => { + const defaultDraftState = JSON.stringify({ + blocks: [ + { + key: 'foo', + text: '', + type: 'unstyled', + depth: 0, + inlineStyleRanges: [], + entityRanges: [], + data: {}, + }, + ], + entityMap: {}, + }); + + return { + title: content.title, + body: content.body ? content.body : defaultDraftState, + }; +}; diff --git a/api/queries/thread/index.js b/api/queries/thread/index.js index 030625d663..17db7d832e 100644 --- a/api/queries/thread/index.js +++ b/api/queries/thread/index.js @@ -14,6 +14,7 @@ import author from './author'; import creator from './creator'; import messageCount from './messageCount'; import currentUserLastSeen from './currentUserLastSeen'; +import content from './content'; module.exports = { Query: { @@ -33,5 +34,6 @@ module.exports = { creator, // deprecated messageCount, currentUserLastSeen, + content, }, }; diff --git a/mobile/components/Login/index.js b/mobile/components/Login/index.js index c4d5defebf..c1d7782924 100644 --- a/mobile/components/Login/index.js +++ b/mobile/components/Login/index.js @@ -5,6 +5,7 @@ import { Text, View, Button } from 'react-native'; import { AuthSession, SecureStore } from 'expo'; import { authenticate } from '../../actions/authentication'; import { DEV_BASE_URI } from '../../../shared/graphql/constants.native'; +import type { Dispatch } from 'redux'; import { Container, Emoji, @@ -26,7 +27,7 @@ const API_URL = type Provider = 'twitter' | 'facebook' | 'google' | 'github'; type Props = { - dispatch: Function, + dispatch: Dispatch, }; class Login extends React.Component { diff --git a/src/actions/toasts.js b/src/actions/toasts.js index 847f2c92d3..ae3fc9ba49 100644 --- a/src/actions/toasts.js +++ b/src/actions/toasts.js @@ -1,4 +1,5 @@ // @flow +import type { Dispatch } from 'redux'; type Toasts = 'success' | 'error' | 'neutral'; const addToast = ( @@ -24,7 +25,7 @@ const removeToast = (id: number) => { let nextToastId = 0; export const addToastWithTimeout = (kind: Toasts, message: string) => ( - dispatch: Function + dispatch: Dispatch ) => { const timeout = kind === 'success' ? 2000 : 4000; const id = nextToastId++; diff --git a/src/components/avatar/hoverProfile.js b/src/components/avatar/hoverProfile.js index b10a02d69d..4b4c49bcff 100644 --- a/src/components/avatar/hoverProfile.js +++ b/src/components/avatar/hoverProfile.js @@ -12,6 +12,7 @@ import addProtocolToString from 'shared/normalize-url'; import { Card } from '../card'; import { initNewThreadWithUser } from '../../actions/directMessageThreads'; import AvatarImage from './image'; +import type { Dispatch } from 'redux'; import { Container, CoverLink, @@ -27,7 +28,7 @@ import { HoverWrapper } from './style'; type ProfileProps = { user: Object, community: ?Object, - dispatch: Function, + dispatch: Dispatch, source: string, currentUser: ?Object, top: ?Boolean, diff --git a/src/components/badges/index.js b/src/components/badges/index.js index 932015ffe0..e51737c644 100644 --- a/src/components/badges/index.js +++ b/src/components/badges/index.js @@ -3,6 +3,7 @@ import * as React from 'react'; import compose from 'recompose/compose'; import { connect } from 'react-redux'; import { openModal } from '../../actions/modals'; +import type { Dispatch } from 'redux'; import { Span, ProBadge, @@ -15,7 +16,7 @@ type Props = { onClick?: Function, tipText: string, currentUser: ?Object, - dispatch: Function, + dispatch: Dispatch, }; class Badge extends React.Component { diff --git a/src/components/chatInput/index.js b/src/components/chatInput/index.js index a7c98eb154..934ae7cc90 100644 --- a/src/components/chatInput/index.js +++ b/src/components/chatInput/index.js @@ -36,6 +36,7 @@ import sendDirectMessage from 'shared/graphql/mutations/message/sendDirectMessag import { getMessageById } from 'shared/graphql/queries/message/getMessage'; import MediaUploader from './components/mediaUploader'; import { QuotedMessage as QuotedMessageComponent } from '../message/view'; +import type { Dispatch } from 'redux'; const QuotedMessage = connect()( getMessageById(props => { @@ -72,7 +73,7 @@ type State = { type Props = { onRef: Function, currentUser: Object, - dispatch: Function, + dispatch: Dispatch, onChange: Function, state: Object, createThread: Function, diff --git a/src/components/composer/index.js b/src/components/composer/index.js index 7dc1ea5649..7372b42173 100644 --- a/src/components/composer/index.js +++ b/src/components/composer/index.js @@ -28,6 +28,7 @@ import { TextButton, Button } from '../buttons'; import { FlexRow } from '../../components/globals'; import { LoadingSelect } from '../loading'; import Titlebar from '../../views/titlebar'; +import type { Dispatch } from 'redux'; import { Container, ThreadDescription, @@ -69,7 +70,7 @@ type Props = { loading: boolean, }, isOpen: boolean, - dispatch: Function, + dispatch: Dispatch, publishThread: Function, history: Object, location: Object, diff --git a/src/components/emailInvitationForm/index.js b/src/components/emailInvitationForm/index.js index 0006e9c2fc..331db15894 100644 --- a/src/components/emailInvitationForm/index.js +++ b/src/components/emailInvitationForm/index.js @@ -11,6 +11,7 @@ import sendCommunityEmailInvitations from 'shared/graphql/mutations/community/se import { Button } from '../buttons'; import { Error } from '../formElements'; import { SectionCardFooter } from '../settingsViews/style'; +import type { Dispatch } from 'redux'; import { EmailInviteForm, EmailInviteInput, diff --git a/src/components/gallery/browser.js b/src/components/gallery/browser.js index a6b23d818a..ff343a55ff 100644 --- a/src/components/gallery/browser.js +++ b/src/components/gallery/browser.js @@ -3,6 +3,7 @@ import * as React from 'react'; import { connect } from 'react-redux'; import { closeGallery } from '../../actions/gallery'; import type { GetMediaMessagesForThreadType } from 'shared/graphql/queries/message/getMediaMessagesForThread'; +import type { Dispatch } from 'redux'; import { Overlay, ActiveImage, @@ -20,7 +21,7 @@ type State = { }; type Props = { - dispatch: Function, + dispatch: Dispatch, data: { messages?: GetMediaMessagesForThreadType, }, diff --git a/src/components/granularUserProfile/index.js b/src/components/granularUserProfile/index.js index 2fcf1c0982..97d5ef0f2d 100644 --- a/src/components/granularUserProfile/index.js +++ b/src/components/granularUserProfile/index.js @@ -9,6 +9,7 @@ import Reputation from '../reputation'; import Badge from '../badges'; import Icon from '../icons'; import { initNewThreadWithUser } from '../../actions/directMessageThreads'; +import type { Dispatch } from 'redux'; import { Row, Name, @@ -35,7 +36,7 @@ type Props = { children?: React.Node, onlineSize?: 'small' | 'large', history: Object, - dispatch: Function, + dispatch: Dispatch, }; // Each prop both provides data AND indicates that the element should be included in the instance of the profile, diff --git a/src/components/message/index.js b/src/components/message/index.js index e82dcefa64..5aa96982fb 100644 --- a/src/components/message/index.js +++ b/src/components/message/index.js @@ -10,6 +10,7 @@ import { openModal } from '../../actions/modals'; import { replyToMessage } from '../../actions/message'; import { track, events } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; import type { MessageInfoType } from 'shared/graphql/fragments/message/messageInfo'; import type { UserInfoType } from 'shared/graphql/fragments/user/userInfo'; @@ -18,7 +19,7 @@ type Props = { threadId: string, threadType: string, selectedId: string, - dispatch: Function, + dispatch: Dispatch, canModerate: boolean, currentUser: UserInfoType, me: boolean, diff --git a/src/components/messageGroup/index.js b/src/components/messageGroup/index.js index 1184b3d552..95dec49bfe 100644 --- a/src/components/messageGroup/index.js +++ b/src/components/messageGroup/index.js @@ -6,6 +6,7 @@ import { convertTimestampToDate } from '../../helpers/utils'; import Badge from '../badges'; import Avatar from '../avatar'; import Message from '../message'; +import type { Dispatch } from 'redux'; import { Byline, @@ -70,7 +71,7 @@ type MessageGroupProps = { thread: Object, // TODO: Refine type isModerator: boolean, toggleReaction: Function, - dispatch: Function, + dispatch: Dispatch, selectedId: string, changeSelection: Function, lastSeen?: number | Date, diff --git a/src/components/modals/AdminEmailAddressVerificationModal/index.js b/src/components/modals/AdminEmailAddressVerificationModal/index.js index 2a2b322f7a..773d3d6b41 100644 --- a/src/components/modals/AdminEmailAddressVerificationModal/index.js +++ b/src/components/modals/AdminEmailAddressVerificationModal/index.js @@ -15,9 +15,10 @@ import getCommunitySettings, { import AdministratorEmailForm from 'src/views/communityBilling/components/administratorEmailForm'; import viewNetworkHandler from 'src/components/viewNetworkHandler'; import ViewError from 'src/components/viewError'; +import type { Dispatch } from 'redux'; type Props = { - dispatch: Function, + dispatch: Dispatch, isOpen: boolean, currentUser: Object, input: Object, diff --git a/src/components/modals/ChangeChannelModal/index.js b/src/components/modals/ChangeChannelModal/index.js index 353885aed7..e0e5a41ae0 100644 --- a/src/components/modals/ChangeChannelModal/index.js +++ b/src/components/modals/ChangeChannelModal/index.js @@ -13,10 +13,11 @@ import Icon from '../../icons'; import { IconContainer } from '../RepExplainerModal/style'; import { Actions, modalStyles, Section, Title, Subtitle } from './style'; import ChannelSelector from './channelSelector'; +import type { Dispatch } from 'redux'; type Props = { thread: any, - dispatch: Function, + dispatch: Dispatch, isOpen: boolean, moveThread: Function, }; diff --git a/src/components/modals/ChatInputLoginModal/index.js b/src/components/modals/ChatInputLoginModal/index.js index b469c2aca5..3c21135063 100644 --- a/src/components/modals/ChatInputLoginModal/index.js +++ b/src/components/modals/ChatInputLoginModal/index.js @@ -9,9 +9,10 @@ import { modalStyles } from '../styles'; import LoginButtonSet from 'src/components/loginButtonSet'; import { Container } from './style'; import { track, events } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; type Props = { - dispatch: Function, + dispatch: Dispatch, isOpen: boolean, modalProps: any, }; diff --git a/src/components/modals/CreateChannelModal/index.js b/src/components/modals/CreateChannelModal/index.js index c67cf66b88..2b57db66fa 100644 --- a/src/components/modals/CreateChannelModal/index.js +++ b/src/components/modals/CreateChannelModal/index.js @@ -16,6 +16,7 @@ import type { GetCommunityType } from 'shared/graphql/queries/community/getCommu import createChannelMutation from 'shared/graphql/mutations/channel/createChannel'; import StripeModalWell from 'src/components/stripeCardForm/modalWell'; import { track, events, transformations } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; import ModalContainer from '../modalContainer'; import { TextButton, Button } from '../../buttons'; @@ -45,7 +46,7 @@ type State = { type Props = { client: Object, - dispatch: Function, + dispatch: Dispatch, isOpen: boolean, community: GetCommunityType, createChannel: Function, diff --git a/src/components/modals/DeleteDoubleCheckModal/index.js b/src/components/modals/DeleteDoubleCheckModal/index.js index 4767a1fe22..36b9209ea7 100644 --- a/src/components/modals/DeleteDoubleCheckModal/index.js +++ b/src/components/modals/DeleteDoubleCheckModal/index.js @@ -22,6 +22,7 @@ import { modalStyles } from '../styles'; import { Actions, Message } from './style'; import cancelSubscription from 'shared/graphql/mutations/community/cancelSubscription'; import disableCommunityAnalytics from 'shared/graphql/mutations/community/disableCommunityAnalytics'; +import type { Dispatch } from 'redux'; /* Generic component that should be used to confirm any 'delete' action. @@ -42,7 +43,7 @@ type State = { }; type Props = { - dispatch: Function, + dispatch: Dispatch, modalProps: { id: string, entity: string, @@ -58,7 +59,7 @@ type Props = { cancelSubscription: Function, disableCommunityAnalytics: Function, archiveChannel: Function, - dispatch: Function, + dispatch: Dispatch, isOpen: boolean, }; diff --git a/src/components/modals/RestoreChannelModal/index.js b/src/components/modals/RestoreChannelModal/index.js index 92ad889f87..09ccde3d25 100644 --- a/src/components/modals/RestoreChannelModal/index.js +++ b/src/components/modals/RestoreChannelModal/index.js @@ -12,9 +12,10 @@ import ModalContainer from '../modalContainer'; import { TextButton, Button } from '../../buttons'; import { modalStyles, Description } from '../styles'; import { Form, Actions } from './style'; +import type { Dispatch } from 'redux'; type Props = { - dispatch: Function, + dispatch: Dispatch, isOpen: boolean, channel: GetChannelType, id: string, diff --git a/src/components/modals/UpgradeAnalyticsModal/index.js b/src/components/modals/UpgradeAnalyticsModal/index.js index f427174f1c..d5f8fc1449 100644 --- a/src/components/modals/UpgradeAnalyticsModal/index.js +++ b/src/components/modals/UpgradeAnalyticsModal/index.js @@ -14,9 +14,10 @@ import StripeCardForm from 'src/components/stripeCardForm'; import enableCommunityAnalytics from 'shared/graphql/mutations/community/enableCommunityAnalytics'; import type { GetCommunitySettingsType } from 'shared/graphql/queries/community/getCommunitySettings'; import PoweredByStripe from '../components/poweredByStripe'; +import type { Dispatch } from 'redux'; type Props = { - dispatch: Function, + dispatch: Dispatch, isOpen: boolean, currentUser: Object, community: GetCommunitySettingsType, diff --git a/src/components/modals/UpgradeModal/index.js b/src/components/modals/UpgradeModal/index.js index 422a796925..0432340be8 100644 --- a/src/components/modals/UpgradeModal/index.js +++ b/src/components/modals/UpgradeModal/index.js @@ -9,6 +9,7 @@ import { addToastWithTimeout } from '../../../actions/toasts'; import { connect } from 'react-redux'; import { Button, OutlineButton } from '../../buttons'; import { UpsellUpgradeToPro } from '../../upsell'; +import type { Dispatch } from 'redux'; import { modalStyles, Section, @@ -20,7 +21,7 @@ import { import { track, events } from 'src/helpers/analytics'; type Props = { - dispatch: Function, + dispatch: Dispatch, downgradeFromPro: Function, isOpen: boolean, user: Object, diff --git a/src/components/modals/UpgradeModeratorSeatModal/index.js b/src/components/modals/UpgradeModeratorSeatModal/index.js index 1b8d295704..a3a87cd2f9 100644 --- a/src/components/modals/UpgradeModeratorSeatModal/index.js +++ b/src/components/modals/UpgradeModeratorSeatModal/index.js @@ -14,9 +14,10 @@ import StripeCardForm from 'src/components/stripeCardForm'; import addCommunityModerator from 'shared/graphql/mutations/communityMember/addCommunityModerator'; import type { GetCommunitySettingsType } from 'shared/graphql/queries/community/getCommunitySettings'; import PoweredByStripe from '../components/poweredByStripe'; +import type { Dispatch } from 'redux'; type Props = { - dispatch: Function, + dispatch: Dispatch, isOpen: boolean, currentUser: Object, input: Object, diff --git a/src/components/profile/channel.js b/src/components/profile/channel.js index b4bf643b28..9ed05bc281 100644 --- a/src/components/profile/channel.js +++ b/src/components/profile/channel.js @@ -17,6 +17,7 @@ import { import Icon from '../icons'; import { Button } from '../buttons'; import { LoadingListItem } from '../loading'; +import type { Dispatch } from 'redux'; import { FullTitle, FullDescription, ProfileCard, FullProfile } from './style'; type State = { @@ -24,7 +25,7 @@ type State = { }; type Props = { - dispatch: Function, + dispatch: Dispatch, toggleChannelSubscription: Function, profileSize: string, currentUser: Object, diff --git a/src/components/profile/community.js b/src/components/profile/community.js index 5be186dfac..8d91e75638 100644 --- a/src/components/profile/community.js +++ b/src/components/profile/community.js @@ -13,6 +13,7 @@ import Avatar from '../avatar'; import { Button, OutlineButton } from '../buttons'; import type { GetCommunityType } from 'shared/graphql/queries/community/getCommunity'; import ToggleCommunityMembership from '../toggleCommunityMembership'; +import type { Dispatch } from 'redux'; import { ProfileHeader, ProfileHeaderLink, @@ -38,7 +39,7 @@ type Props = { onLeave: Function, joinedCommunity?: Function, joinedFirstCommunity?: Function, - dispatch: Function, + dispatch: Dispatch, data: { community: GetCommunityType, loading: boolean, diff --git a/src/components/profile/user.js b/src/components/profile/user.js index 7a9400cc87..20c6f3090d 100644 --- a/src/components/profile/user.js +++ b/src/components/profile/user.js @@ -14,6 +14,7 @@ import Avatar from '../avatar'; import Badge from '../badges'; import { displayLoadingCard } from '../loading'; import Reputation from '../reputation'; +import type { Dispatch } from 'redux'; import { FullProfile, ProfileHeader, @@ -63,7 +64,7 @@ const UserWithData = ({ data: { user: UserProps }, profileSize: ProfileSizeProps, currentUser: CurrentUserProps, - dispatch: Function, + dispatch: Dispatch, history: Object, }): React$Element => { const componentSize = profileSize || 'mini'; diff --git a/src/components/reaction/index.js b/src/components/reaction/index.js index e53ed3b7f2..16a0634744 100644 --- a/src/components/reaction/index.js +++ b/src/components/reaction/index.js @@ -4,10 +4,11 @@ import Icon from '../icons'; import { addToastWithTimeout } from '../../actions/toasts'; import { ReactionWrapper } from '../message/style'; import type { GetMessageType } from 'shared/graphql/queries/message/getMessage'; +import type { Dispatch } from 'redux'; type Props = { toggleReaction: Function, - dispatch: Function, + dispatch: Dispatch, currentUser?: Object, me: boolean, message: GetMessageType, diff --git a/src/components/reputation/index.js b/src/components/reputation/index.js index d5349cec7d..5b1f823d08 100644 --- a/src/components/reputation/index.js +++ b/src/components/reputation/index.js @@ -5,13 +5,14 @@ import { openModal } from '../../actions/modals'; import { truncateNumber } from '../../helpers/utils'; import Icon from '../icons'; import { ReputationWrapper, ReputationLabel } from './style'; +import type { Dispatch } from 'redux'; type Props = { size?: 'mini' | 'default' | 'large', reputation: number, tipText?: string, tipLocation?: string, - dispatch: Function, + dispatch: Dispatch, ignoreClick?: boolean, }; diff --git a/src/components/stripeCardForm/form.js b/src/components/stripeCardForm/form.js index 6b519b9f57..1b301ee5cc 100644 --- a/src/components/stripeCardForm/form.js +++ b/src/components/stripeCardForm/form.js @@ -7,13 +7,14 @@ import addPaymentSourceMutation from 'shared/graphql/mutations/community/addPaym import { addToastWithTimeout } from '../../actions/toasts'; import { style, Actions } from './style'; import type { GetCommunitySettingsType } from 'shared/graphql/queries/community/getCommunitySettings'; +import type { Dispatch } from 'redux'; type Props = { stripe: Object, community: GetCommunitySettingsType, addPaymentSource: Function, children: Function, - dispatch: Function, + dispatch: Dispatch, onCardSaved: ?Function, }; diff --git a/src/components/threadComposer/components/composer.js b/src/components/threadComposer/components/composer.js index 7325970390..cf45e3c9f0 100644 --- a/src/components/threadComposer/components/composer.js +++ b/src/components/threadComposer/components/composer.js @@ -38,10 +38,11 @@ import { DisconnectedWarning, } from '../style'; import { events, track } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; type Props = { isOpen: boolean, - dispatch: Function, + dispatch: Dispatch, isLoading: boolean, activeChannel?: string, activeCommunity?: string, diff --git a/src/components/threadComposer/components/placeholder.js b/src/components/threadComposer/components/placeholder.js index a1f49030de..fe8a5f011a 100644 --- a/src/components/threadComposer/components/placeholder.js +++ b/src/components/threadComposer/components/placeholder.js @@ -5,9 +5,10 @@ import { openComposer } from '../../../actions/composer'; import Icon from '../../icons'; import { Container, Composer, Placeholder, PlaceholderLabel } from '../style'; import Upsell from './upsell'; +import type { Dispatch } from 'redux'; type Props = { - dispatch: Function, + dispatch: Dispatch, isOpen: boolean, isInbox: boolean, showCommunityOwnerUpsell: boolean, diff --git a/src/components/threadFeed/index.js b/src/components/threadFeed/index.js index 2ee4045e04..560a46ad07 100644 --- a/src/components/threadFeed/index.js +++ b/src/components/threadFeed/index.js @@ -16,6 +16,7 @@ import NewActivityIndicator from '../newActivityIndicator'; import ViewError from '../viewError'; import { Upsell, UpsellHeader, UpsellFooter } from './style'; import type { GetCommunityType } from 'shared/graphql/queries/community/getCommunity'; +import type { Dispatch } from 'redux'; const NullState = ({ viewContext, search }) => { let hd; @@ -132,7 +133,7 @@ type Props = { pinnedThreadId: ?string, isNewAndOwned: ?boolean, newActivityIndicator: ?boolean, - dispatch: Function, + dispatch: Dispatch, search?: boolean, }; diff --git a/src/components/toggleChannelMembership/index.js b/src/components/toggleChannelMembership/index.js index b13104709f..9d6de7eaed 100644 --- a/src/components/toggleChannelMembership/index.js +++ b/src/components/toggleChannelMembership/index.js @@ -6,13 +6,14 @@ import { addToastWithTimeout } from '../../actions/toasts'; import type { GetChannelType } from 'shared/graphql/queries/channel/getChannel'; import toggleChannelSubscriptionMutation from 'shared/graphql/mutations/channel/toggleChannelSubscription'; import type { ToggleChannelSubscriptionType } from 'shared/graphql/mutations/channel/toggleChannelSubscription'; +import type { Dispatch } from 'redux'; type Props = { channel: { ...$Exact, }, toggleSubscription: Function, - dispatch: Function, + dispatch: Dispatch, render: Function, onJoin?: Function, onLeave?: Function, diff --git a/src/components/toggleChannelNotifications/index.js b/src/components/toggleChannelNotifications/index.js index c58027ba72..15d803aed8 100644 --- a/src/components/toggleChannelNotifications/index.js +++ b/src/components/toggleChannelNotifications/index.js @@ -7,13 +7,14 @@ import type { GetChannelType } from 'shared/graphql/queries/channel/getChannel'; import toggleChannelNotificationsMutation, { type ToggleChannelNotificationsType, } from 'shared/graphql/mutations/channel/toggleChannelNotifications'; +import type { Dispatch } from 'redux'; type Props = { channel: { ...$Exact, }, toggleChannelNotifications: Function, - dispatch: Function, + dispatch: Dispatch, render: Function, }; diff --git a/src/components/toggleCommunityMembership/index.js b/src/components/toggleCommunityMembership/index.js index 0da711e36c..ad156736fc 100644 --- a/src/components/toggleCommunityMembership/index.js +++ b/src/components/toggleCommunityMembership/index.js @@ -8,6 +8,7 @@ import type { GetCommunityType } from 'shared/graphql/queries/community/getCommu import { addToastWithTimeout } from '../../actions/toasts'; import type { AddCommunityMemberType } from 'shared/graphql/mutations/communityMember/addCommunityMember'; import type { RemoveCommunityMemberType } from 'shared/graphql/mutations/communityMember/removeCommunityMember'; +import type { Dispatch } from 'redux'; type Props = { community: { @@ -15,7 +16,7 @@ type Props = { }, removeCommunityMember: Function, addCommunityMember: Function, - dispatch: Function, + dispatch: Dispatch, render: Function, onJoin?: Function, onLeave?: Function, diff --git a/src/components/upsell/index.js b/src/components/upsell/index.js index ff3619e42e..1772f0349d 100644 --- a/src/components/upsell/index.js +++ b/src/components/upsell/index.js @@ -13,6 +13,7 @@ import ToggleCommunityMembership from '../toggleCommunityMembership'; import { Button, OutlineButton } from '../buttons'; import { Login } from '../../views/login'; import type { GetCommunityType } from 'shared/graphql/queries/community/getCommunity'; +import type { Dispatch } from 'redux'; import { Title, MiniTitle, @@ -294,7 +295,7 @@ export const Upsell404Thread = () => { type MiniUpgradeProps = { currentUser: Object, - dispatch: Function, + dispatch: Dispatch, }; class UpsellMiniUpgradePure extends React.Component { render() { @@ -327,7 +328,7 @@ export const UpsellMiniUpgrade = connect(map)(UpsellMiniUpgradePure); type UpgradeProProps = { upgradeToPro: Function, complete: Function, - dispatch: Function, + dispatch: Dispatch, currentUser: Object, }; diff --git a/src/components/upsell/joinChannel.js b/src/components/upsell/joinChannel.js index ba4610af7f..f24528f481 100644 --- a/src/components/upsell/joinChannel.js +++ b/src/components/upsell/joinChannel.js @@ -5,6 +5,7 @@ import compose from 'recompose/compose'; import toggleChannelSubscriptionMutation from 'shared/graphql/mutations/channel/toggleChannelSubscription'; import type { ToggleChannelSubscriptionType } from 'shared/graphql/mutations/channel/toggleChannelSubscription'; import { addToastWithTimeout } from '../../actions/toasts'; +import type { Dispatch } from 'redux'; import { JoinChannelContainer, JoinChannelContent, @@ -17,7 +18,7 @@ type Props = { channel: Object, community: Object, toggleChannelSubscription: Function, - dispatch: Function, + dispatch: Dispatch, }; type State = { diff --git a/src/components/upsell/requestToJoinChannel.js b/src/components/upsell/requestToJoinChannel.js index 080b303397..711c2b9b49 100644 --- a/src/components/upsell/requestToJoinChannel.js +++ b/src/components/upsell/requestToJoinChannel.js @@ -8,13 +8,14 @@ import type { ToggleChannelSubscriptionType } from 'shared/graphql/mutations/cha import { addToastWithTimeout } from '../../actions/toasts'; import { Button, OutlineButton } from '../buttons'; import { Actions } from './style'; +import type { Dispatch } from 'redux'; type Props = { isPending: boolean, community: Object, channel: Object, toggleChannelSubscription: Function, - dispatch: Function, + dispatch: Dispatch, }; type State = { diff --git a/src/components/userEmailConfirmation/index.js b/src/components/userEmailConfirmation/index.js index 24fe300b1a..a2c05f791a 100644 --- a/src/components/userEmailConfirmation/index.js +++ b/src/components/userEmailConfirmation/index.js @@ -11,12 +11,13 @@ import { EmailForm } from './style'; import { Notice } from '../listItems/style'; import type { GetUserType } from 'shared/graphql/queries/user/getUser'; import { track, events } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; type Props = { render: Function, user: GetUserType, updateUserEmail: Function, - dispatch: Function, + dispatch: Dispatch, }; type State = { diff --git a/src/helpers/realtimeThreads.js b/src/helpers/realtimeThreads.js index a0cd0f8a42..cc3b12d29a 100644 --- a/src/helpers/realtimeThreads.js +++ b/src/helpers/realtimeThreads.js @@ -1,11 +1,12 @@ import { addActivityIndicator } from '../actions/newActivityIndicator'; +import type { Dispatch } from 'redux'; // used to update feed caches with new threads in real time // takes an array of existing threads in the cache and figures out how to insert the newly updated thread export default ( prevThreads: Array, updatedThread: Object, - dispatch: Function + dispatch: Dispatch ) => { // get an array of thread ids based on the threads already in cache const prevThreadIds = prevThreads.map(thread => thread.node.id); diff --git a/src/views/authViewHandler/index.js b/src/views/authViewHandler/index.js index bd12759116..182d6963ad 100644 --- a/src/views/authViewHandler/index.js +++ b/src/views/authViewHandler/index.js @@ -8,10 +8,11 @@ import editUserMutation from 'shared/graphql/mutations/user/editUser'; import { saveUserDataToLocalStorage } from '../../actions/authentication'; import { removeItemFromStorage } from '../../helpers/localStorage'; import NewUserOnboarding from '../../views/newUserOnboarding'; +import type { Dispatch } from 'redux'; type Props = { currentUser?: Object, - dispatch: Function, + dispatch: Dispatch, match: Object, history: Object, editUser: Function, diff --git a/src/views/channel/components/memberGrid.js b/src/views/channel/components/memberGrid.js index 8b25e69040..ad87ea6170 100644 --- a/src/views/channel/components/memberGrid.js +++ b/src/views/channel/components/memberGrid.js @@ -24,7 +24,7 @@ type Props = { }, isLoading: boolean, isFetchingMore: boolean, - dispatch: Function, + dispatch: Dispatch, history: Object, currentUser: ?Object, }; diff --git a/src/views/channel/components/notificationsToggle.js b/src/views/channel/components/notificationsToggle.js index 0de8b37053..9e2514efa0 100644 --- a/src/views/channel/components/notificationsToggle.js +++ b/src/views/channel/components/notificationsToggle.js @@ -15,7 +15,7 @@ type Props = { name: string, }, toggleChannelNotifications: Function, - dispatch: Function, + dispatch: Dispatch, }; type State = { diff --git a/src/views/channel/index.js b/src/views/channel/index.js index fe4b5ece50..f9472b5661 100644 --- a/src/views/channel/index.js +++ b/src/views/channel/index.js @@ -38,6 +38,7 @@ import { CoverPhoto } from '../../components/profile/coverPhoto'; import { LoginButton, ColumnHeading, MidSegment } from '../community/style'; import ToggleChannelMembership from '../../components/toggleChannelMembership'; import { track, events, transformations } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; const ThreadFeedWithData = compose(connect(), getChannelThreadConnection)( ThreadFeed @@ -56,7 +57,7 @@ type Props = { currentUser: Object, isLoading: boolean, hasError: boolean, - dispatch: Function, + dispatch: Dispatch, }; type State = { diff --git a/src/views/channelSettings/components/archiveForm.js b/src/views/channelSettings/components/archiveForm.js index 86becd46f9..4ec2d9eedc 100644 --- a/src/views/channelSettings/components/archiveForm.js +++ b/src/views/channelSettings/components/archiveForm.js @@ -12,10 +12,11 @@ import { SectionCardFooter, } from '../../../components/settingsViews/style'; import { track, events, transformations } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; type Props = { channel: GetChannelType, - dispatch: Function, + dispatch: Dispatch, }; class Channel extends React.Component { diff --git a/src/views/channelSettings/components/channelMembers.js b/src/views/channelSettings/components/channelMembers.js index 5fa4d9b640..aba1dde144 100644 --- a/src/views/channelSettings/components/channelMembers.js +++ b/src/views/channelSettings/components/channelMembers.js @@ -13,6 +13,7 @@ import { SectionCard, SectionTitle } from 'src/components/settingsViews/style'; import { MessageIconContainer, UserListItemContainer } from '../style'; import { ListContainer, ListFooter } from 'src/components/listItems/style'; import Icon from 'src/components/icons'; +import type { Dispatch } from 'redux'; type Props = { data: { @@ -21,7 +22,7 @@ type Props = { }, isLoading: boolean, isFetchingMore: boolean, - dispatch: Function, + dispatch: Dispatch, initMessage: Function, currentUser: ?Object, }; diff --git a/src/views/channelSettings/components/editForm.js b/src/views/channelSettings/components/editForm.js index c563c513fa..6e2e981f49 100644 --- a/src/views/channelSettings/components/editForm.js +++ b/src/views/channelSettings/components/editForm.js @@ -31,6 +31,7 @@ import { Location, } from '../../../components/editForm/style'; import { track, events, transformations } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; type State = { name: string, @@ -44,7 +45,7 @@ type State = { type Props = { editChannel: Function, - dispatch: Function, + dispatch: Dispatch, channel: GetChannelType, }; class ChannelWithData extends React.Component { diff --git a/src/views/channelSettings/components/loginTokenSettings.js b/src/views/channelSettings/components/loginTokenSettings.js index 6d269fa3e5..031e4f622a 100644 --- a/src/views/channelSettings/components/loginTokenSettings.js +++ b/src/views/channelSettings/components/loginTokenSettings.js @@ -21,6 +21,7 @@ import { Input } from 'src/components/formElements'; import { addToastWithTimeout } from 'src/actions/toasts'; import { TokenInputWrapper } from '../style'; import { CLIENT_URL } from 'src/api/constants'; +import type { Dispatch } from 'redux'; type Props = { data: { @@ -28,7 +29,7 @@ type Props = { }, ...$Exact, saveBrandedLoginSettings: Function, - dispatch: Function, + dispatch: Dispatch, }; type State = { diff --git a/src/views/channelSettings/components/loginTokenToggle.js b/src/views/channelSettings/components/loginTokenToggle.js index 86846486c7..aaa231dfe5 100644 --- a/src/views/channelSettings/components/loginTokenToggle.js +++ b/src/views/channelSettings/components/loginTokenToggle.js @@ -6,6 +6,7 @@ import compose from 'recompose/compose'; import enableTokenJoinMutation from 'shared/graphql/mutations/channel/enableChannelTokenJoin'; import disableTokenJoinMutation from 'shared/graphql/mutations/channel/disableChannelTokenJoin'; import { addToastWithTimeout } from '../../../actions/toasts'; +import type { Dispatch } from 'redux'; type Props = { id: string, @@ -14,7 +15,7 @@ type Props = { }, enableChannelTokenJoin: Function, disableChannelTokenJoin: Function, - dispatch: Function, + dispatch: Dispatch, }; class TokenJoinToggle extends React.Component { diff --git a/src/views/channelSettings/components/resetJoinToken.js b/src/views/channelSettings/components/resetJoinToken.js index 33db330989..af34434753 100644 --- a/src/views/channelSettings/components/resetJoinToken.js +++ b/src/views/channelSettings/components/resetJoinToken.js @@ -5,6 +5,7 @@ import compose from 'recompose/compose'; import resetJoinTokenMutation from 'shared/graphql/mutations/channel/resetChannelJoinToken'; import { addToastWithTimeout } from 'src/actions/toasts'; import { OutlineButton } from 'src/components/buttons'; +import type { Dispatch } from 'redux'; type Props = { id: string, @@ -12,7 +13,7 @@ type Props = { tokenJoinEnabled: boolean, }, resetChannelJoinToken: Function, - dispatch: Function, + dispatch: Dispatch, }; type State = { diff --git a/src/views/channelSettings/index.js b/src/views/channelSettings/index.js index 08e18389ee..2bbdc2746f 100644 --- a/src/views/channelSettings/index.js +++ b/src/views/channelSettings/index.js @@ -22,6 +22,7 @@ import Overview from './components/overview'; import Subnav from 'src/components/settingsViews/subnav'; import { initNewThreadWithUser } from 'src/actions/directMessageThreads'; import { track, events, transformations } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; type Props = { data: { @@ -31,7 +32,7 @@ type Props = { match: Object, isLoading: boolean, hasError: boolean, - dispatch: Function, + dispatch: Dispatch, togglePendingUser: Function, unblockUser: Function, history: Object, diff --git a/src/views/community/components/channelList.js b/src/views/community/components/channelList.js index 6e553f978e..e551da2c5b 100644 --- a/src/views/community/components/channelList.js +++ b/src/views/community/components/channelList.js @@ -19,13 +19,14 @@ import { ToggleNotificationsContainer, } from '../style'; import ToggleChannelNotifications from 'src/components/toggleChannelNotifications'; +import type { Dispatch } from 'redux'; type Props = { data: { community: GetCommunityChannelConnectionType, }, isLoading: boolean, - dispatch: Function, + dispatch: Dispatch, currentUser: Object, communitySlug: string, }; diff --git a/src/views/community/components/memberGrid.js b/src/views/community/components/memberGrid.js index 3e5c1fce7a..e8693c89a3 100644 --- a/src/views/community/components/memberGrid.js +++ b/src/views/community/components/memberGrid.js @@ -16,13 +16,14 @@ import viewNetworkHandler from 'src/components/viewNetworkHandler'; import ViewError from 'src/components/viewError'; import { MessageIconContainer, UserListItemContainer } from '../style'; import GranularUserProfile from 'src/components/granularUserProfile'; +import type { Dispatch } from 'redux'; type Props = { data: { community: GetCommunityMembersType, fetchMore: Function, }, - dispatch: Function, + dispatch: Dispatch, isLoading: boolean, isFetchingMore: boolean, history: Object, diff --git a/src/views/community/components/moderatorList.js b/src/views/community/components/moderatorList.js index 5a6cc04efe..9e94a07f5d 100644 --- a/src/views/community/components/moderatorList.js +++ b/src/views/community/components/moderatorList.js @@ -14,13 +14,14 @@ import viewNetworkHandler from 'src/components/viewNetworkHandler'; import ViewError from 'src/components/viewError'; import { MessageIconContainer, ListColumn } from '../style'; import GranularUserProfile from 'src/components/granularUserProfile'; +import type { Dispatch } from 'redux'; type Props = { data: { community: GetCommunityMembersType, fetchMore: Function, }, - dispatch: Function, + dispatch: Dispatch, isLoading: boolean, isFetchingMore: boolean, history: Object, diff --git a/src/views/community/index.js b/src/views/community/index.js index 5e4139b096..f4a49acb56 100644 --- a/src/views/community/index.js +++ b/src/views/community/index.js @@ -50,7 +50,7 @@ const CommunityThreadFeed = compose(connect(), getCommunityThreads)(ThreadFeed); type Props = { ...$Exact, - dispatch: Function, + dispatch: Dispatch, toggleCommunityMembership: Function, currentUser: Object, match: { diff --git a/src/views/communityAnalytics/components/analyticsUpsell/index.js b/src/views/communityAnalytics/components/analyticsUpsell/index.js index a3617b8cb3..b7493a45fe 100644 --- a/src/views/communityAnalytics/components/analyticsUpsell/index.js +++ b/src/views/communityAnalytics/components/analyticsUpsell/index.js @@ -19,11 +19,12 @@ import { import Link from 'src/components/link'; import { Button, TextButton } from 'src/components/buttons'; import { track, events, transformations } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; type Props = { community: GetCommunitySettingsType, enableCommunityAnalytics: Function, - dispatch: Function, + dispatch: Dispatch, }; type State = { diff --git a/src/views/communityAnalytics/components/topMembers.js b/src/views/communityAnalytics/components/topMembers.js index 9864d073d7..696a933d15 100644 --- a/src/views/communityAnalytics/components/topMembers.js +++ b/src/views/communityAnalytics/components/topMembers.js @@ -13,13 +13,14 @@ import GranularUserProfile from 'src/components/granularUserProfile'; import getCommunityTopMembers from 'shared/graphql/queries/community/getCommunityTopMembers'; import type { GetCommunityTopMembersType } from 'shared/graphql/queries/community/getCommunityTopMembers'; import { UserListItemContainer, MessageIconContainer } from '../style'; +import type { Dispatch } from 'redux'; type Props = { isLoading: boolean, data: { community: GetCommunityTopMembersType, }, - dispatch: Function, + dispatch: Dispatch, history: Object, currentUser: ?Object, }; diff --git a/src/views/communityAnalytics/index.js b/src/views/communityAnalytics/index.js index 0689720b20..bfd1454853 100644 --- a/src/views/communityAnalytics/index.js +++ b/src/views/communityAnalytics/index.js @@ -16,12 +16,13 @@ import { Column, } from '../../components/settingsViews/style'; import { track, events, transformations } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; type Props = { currentUser: Object, community: GetCommunitySettingsType, communitySlug: string, - dispatch: Function, + dispatch: Dispatch, match: Object, }; diff --git a/src/views/communityBilling/components/administratorEmailForm.js b/src/views/communityBilling/components/administratorEmailForm.js index f6cef851d3..f77bdebdd2 100644 --- a/src/views/communityBilling/components/administratorEmailForm.js +++ b/src/views/communityBilling/components/administratorEmailForm.js @@ -9,6 +9,7 @@ import { Input, Error } from '../../../components/formElements'; import { Notice } from '../../../components/listItems/style'; import { Button } from '../../../components/buttons'; import updateAdministratorEmailMutation from 'shared/graphql/mutations/community/updateAdministratorEmail'; +import type { Dispatch } from 'redux'; import { EmailForm } from '../style'; import { SectionCard, @@ -18,7 +19,7 @@ import { type Props = { id: string, - dispatch: Function, + dispatch: Dispatch, community: GetCommunitySettingsType, updateAdministratorEmail: Function, }; diff --git a/src/views/communityBilling/components/editSourceDropdown.js b/src/views/communityBilling/components/editSourceDropdown.js index 6c86d5cdd6..42f72b31e3 100644 --- a/src/views/communityBilling/components/editSourceDropdown.js +++ b/src/views/communityBilling/components/editSourceDropdown.js @@ -19,11 +19,12 @@ import MutationWrapper from './mutationWrapper'; import removePaymentSource from 'shared/graphql/mutations/community/removePaymentSource'; import makePaymentSourceDefault from 'shared/graphql/mutations/community/makePaymentSourceDefault'; import type { GetCommunitySettingsType } from 'shared/graphql/queries/community/getCommunitySettings'; +import type { Dispatch } from 'redux'; type Props = { removePaymentSource: Function, makePaymentSourceDefault: Function, - dispatch: Function, + dispatch: Dispatch, community: GetCommunitySettingsType, source: { id: string, diff --git a/src/views/communityBilling/components/mutationWrapper.js b/src/views/communityBilling/components/mutationWrapper.js index a4e3898824..34a1f82ff9 100644 --- a/src/views/communityBilling/components/mutationWrapper.js +++ b/src/views/communityBilling/components/mutationWrapper.js @@ -2,12 +2,13 @@ import * as React from 'react'; import { connect } from 'react-redux'; import { addToastWithTimeout } from '../../../actions/toasts'; +import type { Dispatch } from 'redux'; type Props = { onMutationEnd: Function, mutation: ?Function, variables: any, - dispatch: Function, + dispatch: Dispatch, render: ({ isLoading: boolean }) => any, }; diff --git a/src/views/communityBilling/components/subscription.js b/src/views/communityBilling/components/subscription.js index cf6ecc1234..d3e0003869 100644 --- a/src/views/communityBilling/components/subscription.js +++ b/src/views/communityBilling/components/subscription.js @@ -6,6 +6,7 @@ import type { SubscriptionType } from 'shared/graphql/fragments/community/commun import Link from '../../../components/link'; import { formatNumbersToDollars } from '../utils'; import { openModal } from 'src/actions/modals'; +import type { Dispatch } from 'redux'; import { LineItem, LineItemLeft, @@ -27,7 +28,7 @@ import { type Props = { subscription: SubscriptionType, community: GetCommunitySettingsType, - dispatch: Function, + dispatch: Dispatch, }; type LineItemType = { id: string, diff --git a/src/views/communityBilling/index.js b/src/views/communityBilling/index.js index e7192fd8fa..9df4a4d046 100644 --- a/src/views/communityBilling/index.js +++ b/src/views/communityBilling/index.js @@ -21,11 +21,12 @@ import Subscription from './components/subscription'; import AdministratorEmailForm from './components/administratorEmailForm'; import Source from './components/source'; import Invoice from './components/invoice'; +import type { Dispatch } from 'redux'; type Props = { currentUser: Object, community: GetCommunitySettingsType, - dispatch: Function, + dispatch: Dispatch, match: Object, history: Object, }; diff --git a/src/views/communityMembers/components/communityMembers.js b/src/views/communityMembers/components/communityMembers.js index 4778d57cc2..5d1e04cdf1 100644 --- a/src/views/communityMembers/components/communityMembers.js +++ b/src/views/communityMembers/components/communityMembers.js @@ -26,12 +26,13 @@ import { initNewThreadWithUser } from '../../../actions/directMessageThreads'; import ViewError from '../../../components/viewError'; import GranularUserProfile from '../../../components/granularUserProfile'; import { Notice } from '../../../components/listItems/style'; +import type { Dispatch } from 'redux'; type Props = { id: string, client: Object, currentUser: Object, - dispatch: Function, + dispatch: Dispatch, history: Object, community: Object, }; diff --git a/src/views/communityMembers/components/editDropdown.js b/src/views/communityMembers/components/editDropdown.js index 41bb9c736a..5be293801e 100644 --- a/src/views/communityMembers/components/editDropdown.js +++ b/src/views/communityMembers/components/editDropdown.js @@ -27,13 +27,14 @@ import unblockCommunityMember from 'shared/graphql/mutations/communityMember/unb import type { GetCommunitySettingsType } from 'shared/graphql/queries/community/getCommunitySettings'; import MutationWrapper from './mutationWrapper'; import { getCardImage } from '../../communityBilling/utils'; +import type { Dispatch } from 'redux'; type Props = { blockCommunityMember: Function, unblockCommunityMember: Function, addCommunityModerator: Function, removeCommunityModerator: Function, - dispatch: Function, + dispatch: Dispatch, community: GetCommunitySettingsType, history: Object, user: { diff --git a/src/views/communityMembers/components/mutationWrapper.js b/src/views/communityMembers/components/mutationWrapper.js index 6550f04d7a..1b1cdb01e0 100644 --- a/src/views/communityMembers/components/mutationWrapper.js +++ b/src/views/communityMembers/components/mutationWrapper.js @@ -2,11 +2,12 @@ import * as React from 'react'; import { connect } from 'react-redux'; import { addToastWithTimeout } from '../../../actions/toasts'; +import type { Dispatch } from 'redux'; type Props = { mutation: ?Function, variables: any, - dispatch: Function, + dispatch: Dispatch, render: Function, }; diff --git a/src/views/communityMembers/index.js b/src/views/communityMembers/index.js index 117649f106..ac6c67dc5b 100644 --- a/src/views/communityMembers/index.js +++ b/src/views/communityMembers/index.js @@ -9,6 +9,7 @@ import { Button, OutlineButton, ButtonRow } from '../../components/buttons'; import { CommunityInvitationForm } from '../../components/emailInvitationForm'; import SlackConnection from '../communitySettings/components/slack'; import CommunityMembers from './components/communityMembers'; +import type { Dispatch } from 'redux'; import { SectionsContainer, SectionCard, @@ -19,7 +20,7 @@ import { type Props = { currentUser: Object, community: GetCommunityType, - dispatch: Function, + dispatch: Dispatch, match: Object, history: Object, }; diff --git a/src/views/communitySettings/components/brandedLogin.js b/src/views/communitySettings/components/brandedLogin.js index d84b7619d7..993d14cebd 100644 --- a/src/views/communitySettings/components/brandedLogin.js +++ b/src/views/communitySettings/components/brandedLogin.js @@ -22,6 +22,7 @@ import { Button, OutlineButton } from 'src/components/buttons'; import { TextArea, Error } from 'src/components/formElements'; import saveBrandedLoginSettings from 'shared/graphql/mutations/community/saveBrandedLoginSettings'; import { addToastWithTimeout } from '../../../actions/toasts'; +import type { Dispatch } from 'redux'; type Props = { data: { @@ -29,7 +30,7 @@ type Props = { }, ...$Exact, saveBrandedLoginSettings: Function, - dispatch: Function, + dispatch: Dispatch, }; type State = { diff --git a/src/views/communitySettings/components/brandedLoginToggle.js b/src/views/communitySettings/components/brandedLoginToggle.js index 6dd3bfa30f..91a642442e 100644 --- a/src/views/communitySettings/components/brandedLoginToggle.js +++ b/src/views/communitySettings/components/brandedLoginToggle.js @@ -6,6 +6,7 @@ import compose from 'recompose/compose'; import enableBrandedLoginMutation from 'shared/graphql/mutations/community/enableBrandedLogin'; import disableBrandedLoginMutation from 'shared/graphql/mutations/community/disableBrandedLogin'; import { addToastWithTimeout } from '../../../actions/toasts'; +import type { Dispatch } from 'redux'; type Props = { id: string, @@ -14,7 +15,7 @@ type Props = { }, enableBrandedLogin: Function, disableBrandedLogin: Function, - dispatch: Function, + dispatch: Dispatch, }; class BrandedLoginToggle extends React.Component { diff --git a/src/views/communitySettings/components/channelList.js b/src/views/communitySettings/components/channelList.js index d5580f2a16..cffd0c6d28 100644 --- a/src/views/communitySettings/components/channelList.js +++ b/src/views/communitySettings/components/channelList.js @@ -11,6 +11,7 @@ import viewNetworkHandler from '../../../components/viewNetworkHandler'; import ViewError from '../../../components/viewError'; import getCommunityChannels from 'shared/graphql/queries/community/getCommunityChannelConnection'; import type { GetCommunityChannelConnectionType } from 'shared/graphql/queries/community/getCommunityChannelConnection'; +import type { Dispatch } from 'redux'; import { ListContainer } from '../style'; import { SectionCard, @@ -23,7 +24,7 @@ type Props = { community: GetCommunityChannelConnectionType, }, isLoading: boolean, - dispatch: Function, + dispatch: Dispatch, communitySlug: string, }; diff --git a/src/views/communitySettings/components/editForm.js b/src/views/communitySettings/components/editForm.js index 8db2d7649b..877779a4a1 100644 --- a/src/views/communitySettings/components/editForm.js +++ b/src/views/communitySettings/components/editForm.js @@ -31,6 +31,7 @@ import { SectionTitle, } from '../../../components/settingsViews/style'; import { track, events, transformations } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; type State = { name: string, @@ -50,7 +51,7 @@ type State = { type Props = { community: GetCommunityType, - dispatch: Function, + dispatch: Dispatch, editCommunity: Function, }; diff --git a/src/views/communitySettings/components/slack/channelConnection.js b/src/views/communitySettings/components/slack/channelConnection.js index 36aca01ded..a0d0240273 100644 --- a/src/views/communitySettings/components/slack/channelConnection.js +++ b/src/views/communitySettings/components/slack/channelConnection.js @@ -19,6 +19,7 @@ import ViewError from 'src/components/viewError'; import ChannelSlackManager from './channelSlackManager'; import { ChannelListContainer } from './style'; import Icon from 'src/components/icons'; +import type { Dispatch } from 'redux'; type Props = { ...$Exact, @@ -26,7 +27,7 @@ type Props = { community: GetCommunityChannelsSlackSettings, }, updateChannelSlackSettings: Function, - dispatch: Function, + dispatch: Dispatch, channelFilter?: string, }; diff --git a/src/views/communitySettings/components/slack/channelSlackManager.js b/src/views/communitySettings/components/slack/channelSlackManager.js index 4b958789f5..ea6d5cca7f 100644 --- a/src/views/communitySettings/components/slack/channelSlackManager.js +++ b/src/views/communitySettings/components/slack/channelSlackManager.js @@ -12,6 +12,7 @@ import { } from './style'; import { addToastWithTimeout } from 'src/actions/toasts'; import updateChannelSlackBotLinksMutation from 'shared/graphql/mutations/channel/updateChannelSlackBotLinks'; +import type { Dispatch } from 'redux'; type SlackChannel = { id: string, @@ -31,7 +32,7 @@ type Props = { slackChannels: Array, channel: ChannelWithSlackSettings, updateChannelSlackBotLinks: Function, - dispatch: Function, + dispatch: Dispatch, }; class ChannelSlackManager extends React.Component { diff --git a/src/views/communitySettings/components/slack/sendInvitations.js b/src/views/communitySettings/components/slack/sendInvitations.js index 2fb0d8aad0..a69a71e4ac 100644 --- a/src/views/communitySettings/components/slack/sendInvitations.js +++ b/src/views/communitySettings/components/slack/sendInvitations.js @@ -15,11 +15,12 @@ import sendSlackInvitesMutation from 'shared/graphql/mutations/community/sendSla import { addToastWithTimeout } from 'src/actions/toasts'; import { timeDifference } from 'src/helpers/utils'; import Icon from 'src/components/icons'; +import type { Dispatch } from 'redux'; type Props = { community: GetSlackSettingsType, sendSlackInvites: Function, - dispatch: Function, + dispatch: Dispatch, }; type State = { customMessage: ?string, isLoading: boolean }; diff --git a/src/views/dashboard/components/communityList.js b/src/views/dashboard/components/communityList.js index 1cdc6acbde..af3377d612 100644 --- a/src/views/dashboard/components/communityList.js +++ b/src/views/dashboard/components/communityList.js @@ -24,9 +24,10 @@ import { } from '../../../actions/dashboardFeed'; import type { GetCommunityType } from 'shared/graphql/queries/community/getCommunity'; import { track, events } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; type Props = { - dispatch: Function, + dispatch: Dispatch, history: Object, activeCommunity: ?string, activeChannel: ?string, diff --git a/src/views/dashboard/components/inboxThread.js b/src/views/dashboard/components/inboxThread.js index 815ad6bb38..8b695cb46a 100644 --- a/src/views/dashboard/components/inboxThread.js +++ b/src/views/dashboard/components/inboxThread.js @@ -9,6 +9,7 @@ import truncate from 'shared/truncate'; import ThreadCommunityInfo, { WaterCoolerPill } from './threadCommunityInfo'; import { changeActiveThread } from '../../../actions/dashboardFeed'; import type { ThreadInfoType } from 'shared/graphql/fragments/thread/threadInfo'; +import type { Dispatch } from 'redux'; import { InboxThreadItem, InboxLinkWrapper, @@ -26,7 +27,7 @@ import { type Props = { active: boolean, - dispatch: Function, + dispatch: Dispatch, hasActiveChannel: ?string, hasActiveCommunity: ?string, history: Object, diff --git a/src/views/dashboard/components/sidebarChannels.js b/src/views/dashboard/components/sidebarChannels.js index 9a7824bdf4..ce109c8394 100644 --- a/src/views/dashboard/components/sidebarChannels.js +++ b/src/views/dashboard/components/sidebarChannels.js @@ -21,9 +21,10 @@ import { SectionTitle, } from '../style'; import { track, events } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; type Props = { - dispatch: Function, + dispatch: Dispatch, isLoading: boolean, queryVarIsChanging: boolean, activeChannel: ?string, diff --git a/src/views/dashboard/components/threadFeed.js b/src/views/dashboard/components/threadFeed.js index 195c1d6cf5..aa057be807 100644 --- a/src/views/dashboard/components/threadFeed.js +++ b/src/views/dashboard/components/threadFeed.js @@ -20,6 +20,7 @@ import viewNetworkHandler from '../../../components/viewNetworkHandler'; import type { ViewNetworkHandlerType } from '../../../components/viewNetworkHandler'; import type { GetThreadType } from 'shared/graphql/queries/thread/getThread'; import type { GetCommunityThreadConnectionType } from 'shared/graphql/queries/community/getCommunityThreadConnection'; +import type { Dispatch } from 'redux'; type Node = { node: { @@ -42,7 +43,7 @@ type Props = { feed: string, }, history: Function, - dispatch: Function, + dispatch: Dispatch, selectedId: string, activeCommunity: ?string, hasActiveCommunity: boolean, diff --git a/src/views/dashboard/components/threadSearch.js b/src/views/dashboard/components/threadSearch.js index d589ab025b..424569f93b 100644 --- a/src/views/dashboard/components/threadSearch.js +++ b/src/views/dashboard/components/threadSearch.js @@ -3,6 +3,7 @@ import compose from 'recompose/compose'; import { connect } from 'react-redux'; import { SearchInput, SearchForm, SearchInputDiv } from '../style'; import Icon from '../../../components/icons'; +import type { Dispatch } from 'redux'; import { closeSearch, openSearch, @@ -10,7 +11,7 @@ import { } from '../../../actions/dashboardFeed'; type Props = { - dispatch: Function, + dispatch: Dispatch, filter: { communityId?: ?string, channelId?: ?string, diff --git a/src/views/dashboard/components/threadSelectorHeader.js b/src/views/dashboard/components/threadSelectorHeader.js index aaa4a629ce..99973e0fce 100644 --- a/src/views/dashboard/components/threadSelectorHeader.js +++ b/src/views/dashboard/components/threadSelectorHeader.js @@ -14,9 +14,10 @@ import ThreadSearch from './threadSearch'; import Menu from '../../../components/menu'; import CommunityList from './communityList'; import Link from 'src/components/link'; +import type { Dispatch } from 'redux'; type Props = { - dispatch: Function, + dispatch: Dispatch, filter: Object, communities: Array, user: Object, diff --git a/src/views/directMessages/containers/index.js b/src/views/directMessages/containers/index.js index 1f192332f5..3f534f0caf 100644 --- a/src/views/directMessages/containers/index.js +++ b/src/views/directMessages/containers/index.js @@ -15,11 +15,12 @@ import ViewError from '../../../components/viewError'; import Titlebar from '../../titlebar'; import { View, MessagesList, ComposeHeader } from '../style'; import { track, events } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; type Props = { subscribeToUpdatedDirectMessageThreads: Function, markDirectMessageNotificationsSeen: Function, - dispatch: Function, + dispatch: Dispatch, match: Object, currentUser?: Object, hasError: boolean, diff --git a/src/views/directMessages/containers/newThread.js b/src/views/directMessages/containers/newThread.js index cc647eee0b..028406621e 100644 --- a/src/views/directMessages/containers/newThread.js +++ b/src/views/directMessages/containers/newThread.js @@ -18,6 +18,7 @@ import { Spinner } from '../../../components/globals'; import { addToastWithTimeout } from '../../../actions/toasts'; import { clearDirectMessagesComposer } from '../../../actions/directMessageThreads'; import createDirectMessageThreadMutation from 'shared/graphql/mutations/directMessageThread/createDirectMessageThread'; +import type { Dispatch } from 'redux'; import { ComposerInputWrapper, Grow, @@ -54,7 +55,7 @@ type Props = { initNewThreadWithUser: Array, threads: Array, hideOnMobile: boolean, - dispatch: Function, + dispatch: Dispatch, createDirectMessageThread: Function, threadSliderIsOpen: boolean, history: Object, diff --git a/src/views/explore/components/search.js b/src/views/explore/components/search.js index 6eef775d55..f5fb5dc204 100644 --- a/src/views/explore/components/search.js +++ b/src/views/explore/components/search.js @@ -39,7 +39,7 @@ type State = { type Props = { client: Object, history: Object, - dispatch: Function, + dispatch: Dispatch, }; class Search extends React.Component { diff --git a/src/views/navbar/components/messagesTab.js b/src/views/navbar/components/messagesTab.js index bcb56ec256..14741d7d05 100644 --- a/src/views/navbar/components/messagesTab.js +++ b/src/views/navbar/components/messagesTab.js @@ -10,6 +10,7 @@ import type { GetDirectMessageNotificationsType } from 'shared/graphql/queries/n import markDirectMessageNotificationsSeenMutation from 'shared/graphql/mutations/notification/markDirectMessageNotificationsSeen'; import { Tab, Label } from '../style'; import { track, events } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; type Props = { active: boolean, @@ -23,7 +24,7 @@ type Props = { subscribeToDMs: Function, refetch: Function, count: number, - dispatch: Function, + dispatch: Dispatch, }; type State = { diff --git a/src/views/navbar/components/notificationsTab.js b/src/views/navbar/components/notificationsTab.js index 4e63c02d22..00bfa80658 100644 --- a/src/views/navbar/components/notificationsTab.js +++ b/src/views/navbar/components/notificationsTab.js @@ -15,6 +15,7 @@ import { markSingleNotificationSeenMutation } from 'shared/graphql/mutations/not import { Tab, NotificationTab, Label } from '../style'; import { deduplicateChildren } from 'src/components/infiniteScroll/deduplicateChildren'; import { track, events } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; type Props = { active: boolean, @@ -32,7 +33,7 @@ type Props = { }, refetch: Function, client: Function, - dispatch: Function, + dispatch: Dispatch, count: number, }; diff --git a/src/views/newCommunity/components/createCommunityForm/index.js b/src/views/newCommunity/components/createCommunityForm/index.js index b797c49eb8..ec41130b44 100644 --- a/src/views/newCommunity/components/createCommunityForm/index.js +++ b/src/views/newCommunity/components/createCommunityForm/index.js @@ -34,6 +34,7 @@ import { } from './style'; import { FormContainer, Form, Actions } from '../../style'; import { track, events } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; type State = { name: ?string, @@ -59,7 +60,7 @@ type Props = { client: Object, createCommunity: Function, communityCreated: Function, - dispatch: Function, + dispatch: Dispatch, name: string, }; class CreateCommunityForm extends React.Component { diff --git a/src/views/newCommunity/components/editCommunityForm/index.js b/src/views/newCommunity/components/editCommunityForm/index.js index 361d381472..33f0d1c68f 100644 --- a/src/views/newCommunity/components/editCommunityForm/index.js +++ b/src/views/newCommunity/components/editCommunityForm/index.js @@ -19,6 +19,7 @@ import { } from '../../../../components/formElements'; import { ImageInputWrapper } from '../../../../components/editForm/style'; import { Actions, FormContainer, Form } from '../../style'; +import type { Dispatch } from 'redux'; type State = { name: string, @@ -38,7 +39,7 @@ type State = { type Props = { community: GetCommunityType, - dispatch: Function, + dispatch: Dispatch, communityUpdated: Function, editCommunity: Function, }; diff --git a/src/views/newUserOnboarding/components/communitySearch/index.js b/src/views/newUserOnboarding/components/communitySearch/index.js index 82215754d6..3dfa5b7e02 100644 --- a/src/views/newUserOnboarding/components/communitySearch/index.js +++ b/src/views/newUserOnboarding/components/communitySearch/index.js @@ -10,6 +10,7 @@ import ToggleCommunityMembership from '../../../../components/toggleCommunityMem import { throttle } from '../../../../helpers/utils'; import { searchCommunitiesQuery } from 'shared/graphql/queries/search/searchCommunities'; import { Spinner } from '../../../../components/globals'; +import type { Dispatch } from 'redux'; import { SearchWrapper, SearchInput, @@ -36,7 +37,7 @@ type State = { type Props = { toggleCommunityMembership: Function, - dispatch: Function, + dispatch: Dispatch, client: Object, joinedCommunity: Function, }; diff --git a/src/views/newUserOnboarding/components/joinFirstCommunity/index.js b/src/views/newUserOnboarding/components/joinFirstCommunity/index.js index 629e1c0924..0b0f1ca30c 100644 --- a/src/views/newUserOnboarding/components/joinFirstCommunity/index.js +++ b/src/views/newUserOnboarding/components/joinFirstCommunity/index.js @@ -4,10 +4,11 @@ import compose from 'recompose/compose'; import { connect } from 'react-redux'; import { Row } from '../discoverCommunities/style'; import { CommunityProfile } from '../../../../components/profile'; +import type { Dispatch } from 'redux'; type Props = { toggleCommunityMembership: Function, - dispatch: Function, + dispatch: Dispatch, joinedFirstCommunity: Function, joinedCommunity: Function, community: { diff --git a/src/views/newUserOnboarding/components/setUsername/index.js b/src/views/newUserOnboarding/components/setUsername/index.js index e4f8598237..80ba2063bc 100644 --- a/src/views/newUserOnboarding/components/setUsername/index.js +++ b/src/views/newUserOnboarding/components/setUsername/index.js @@ -10,12 +10,13 @@ import { addToastWithTimeout } from '../../../../actions/toasts'; import { Form, Row, InputLabel, InputSubLabel } from './style'; import editUserMutation from 'shared/graphql/mutations/user/editUser'; import { ContinueButton } from '../../style'; +import type { Dispatch } from 'redux'; type Props = { client: Object, editUser: Function, save: Function, - dispatch: Function, + dispatch: Dispatch, user: ?Object, }; diff --git a/src/views/notifications/index.js b/src/views/notifications/index.js index 9bf7500e3b..46b98d3dae 100644 --- a/src/views/notifications/index.js +++ b/src/views/notifications/index.js @@ -38,11 +38,12 @@ import BrowserNotificationRequest from './components/browserNotificationRequest' import generateMetaInfo from 'shared/generate-meta-info'; import viewNetworkHandler from '../../components/viewNetworkHandler'; import { track, events } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; type Props = { markAllNotificationsSeen?: Function, subscribeToWebPush: Function, - dispatch: Function, + dispatch: Dispatch, currentUser: Object, isFetchingMore: boolean, data: { diff --git a/src/views/privateChannelJoin/index.js b/src/views/privateChannelJoin/index.js index 02e2af629b..f28308db2c 100644 --- a/src/views/privateChannelJoin/index.js +++ b/src/views/privateChannelJoin/index.js @@ -8,6 +8,7 @@ import CommunityLogin from 'src/views/communityLogin'; import AppViewWrapper from 'src/components/appViewWrapper'; import { Loading } from 'src/components/loading'; import { CLIENT_URL } from 'src/api/constants'; +import type { Dispatch } from 'redux'; type Props = { match: Object, @@ -15,7 +16,7 @@ type Props = { history: Object, joinChannelWithToken: Function, currentUser: Object, - dispatch: Function, + dispatch: Dispatch, }; type State = { diff --git a/src/views/status/index.js b/src/views/status/index.js index 659144f7f0..3cf89e8c28 100644 --- a/src/views/status/index.js +++ b/src/views/status/index.js @@ -5,10 +5,11 @@ import { Bar } from './style'; import { withRouter } from 'react-router'; import compose from 'recompose/compose'; import { isViewingMarketingPage } from 'src/helpers/is-viewing-marketing-page'; +import type { Dispatch } from 'redux'; type Props = { websocketConnection: string, - dispatch: Function, + dispatch: Dispatch, history: Object, currentUser: Object, }; diff --git a/src/views/thread/components/actionBar.js b/src/views/thread/components/actionBar.js index 9f11080470..801ab2c86e 100644 --- a/src/views/thread/components/actionBar.js +++ b/src/views/thread/components/actionBar.js @@ -13,6 +13,7 @@ import type { GetThreadType } from 'shared/graphql/queries/thread/getThread'; import toggleThreadNotificationsMutation from 'shared/graphql/mutations/thread/toggleThreadNotifications'; import OutsideClickHandler from '../../../components/outsideClickHandler'; import { track, events, transformations } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; import { FollowButton, @@ -29,7 +30,7 @@ type Props = { thread: GetThreadType, currentUser: Object, isEditing: boolean, - dispatch: Function, + dispatch: Dispatch, toggleThreadNotifications: Function, toggleEdit: Function, saveEdit: Function, diff --git a/src/views/thread/components/sidebar.js b/src/views/thread/components/sidebar.js index ef1078156c..83fc4df3b0 100644 --- a/src/views/thread/components/sidebar.js +++ b/src/views/thread/components/sidebar.js @@ -14,6 +14,7 @@ import { connect } from 'react-redux'; import compose from 'recompose/compose'; import { CLIENT_URL } from 'src/api/constants'; import Icon from 'src/components/icons'; +import type { Dispatch } from 'redux'; import { SidebarSection, SidebarSectionTitle, @@ -45,7 +46,7 @@ type Props = { threads: Array, }, toggleCommunityMembership: Function, - dispatch: Function, + dispatch: Dispatch, threadViewLoading?: boolean, }; diff --git a/src/views/thread/components/threadCommunityBanner.js b/src/views/thread/components/threadCommunityBanner.js index 3a539adedd..3b48bb1479 100644 --- a/src/views/thread/components/threadCommunityBanner.js +++ b/src/views/thread/components/threadCommunityBanner.js @@ -10,6 +10,7 @@ import type { GetThreadType } from 'shared/graphql/queries/thread/getThread'; import { addToastWithTimeout } from '../../../actions/toasts'; import Avatar from '../../../components/avatar'; import { CLIENT_URL } from 'src/api/constants'; +import type { Dispatch } from 'redux'; import { CommunityHeader, CommunityHeaderName, @@ -22,7 +23,7 @@ import { } from '../style'; type Props = { - dispatch: Function, + dispatch: Dispatch, toggleChannelSubscription: Function, currentUser: Object, hide: boolean, diff --git a/src/views/thread/components/threadDetail.js b/src/views/thread/components/threadDetail.js index 176afb7ef2..ca6ff9bd31 100644 --- a/src/views/thread/components/threadDetail.js +++ b/src/views/thread/components/threadDetail.js @@ -32,6 +32,7 @@ import { Edited, } from '../style'; import { track, events, transformations } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; const ENDS_IN_WHITESPACE = /(\s|\n)$/; @@ -56,7 +57,7 @@ type Props = { setThreadLock: Function, pinThread: Function, editThread: Function, - dispatch: Function, + dispatch: Dispatch, currentUser: ?Object, toggleEdit: Function, }; diff --git a/src/views/thread/components/watercoolerActionBar.js b/src/views/thread/components/watercoolerActionBar.js index 324f9c1aa7..e275dec657 100644 --- a/src/views/thread/components/watercoolerActionBar.js +++ b/src/views/thread/components/watercoolerActionBar.js @@ -8,6 +8,7 @@ import Icon from '../../../components/icons'; import compose from 'recompose/compose'; import type { GetThreadType } from 'shared/graphql/queries/thread/getThread'; import toggleThreadNotificationsMutation from 'shared/graphql/mutations/thread/toggleThreadNotifications'; +import type { Dispatch } from 'redux'; import { FollowButton, ShareButtons, @@ -18,7 +19,7 @@ import { type Props = { thread: GetThreadType, currentUser: Object, - dispatch: Function, + dispatch: Dispatch, toggleThreadNotifications: Function, }; diff --git a/src/views/thread/container.js b/src/views/thread/container.js index 7a3d2f669c..6f53145aed 100644 --- a/src/views/thread/container.js +++ b/src/views/thread/container.js @@ -23,6 +23,7 @@ import LoadingView from './components/loading'; import ThreadCommunityBanner from './components/threadCommunityBanner'; import Sidebar from './components/sidebar'; import type { GetThreadType } from 'shared/graphql/queries/thread/getThread'; +import type { Dispatch } from 'redux'; import { ThreadViewContainer, ThreadContentView, @@ -45,7 +46,7 @@ type Props = { isLoading: boolean, hasError: boolean, currentUser: Object, - dispatch: Function, + dispatch: Dispatch, slider: boolean, threadViewContext: 'slider' | 'fullscreen' | 'inbox', threadSliderIsOpen: boolean, diff --git a/src/views/user/index.js b/src/views/user/index.js index 6d54a327b7..bf170c966e 100644 --- a/src/views/user/index.js +++ b/src/views/user/index.js @@ -22,6 +22,7 @@ import viewNetworkHandler from '../../components/viewNetworkHandler'; import Titlebar from '../titlebar'; import { CoverPhoto } from '../../components/profile/coverPhoto'; import { LoginButton } from '../community/style'; +import type { Dispatch } from 'redux'; import { Grid, Meta, @@ -54,7 +55,7 @@ type Props = { isLoading: boolean, hasError: boolean, queryVarIsChanging: boolean, - dispatch: Function, + dispatch: Dispatch, history: Object, }; diff --git a/src/views/userSettings/components/deleteAccountForm.js b/src/views/userSettings/components/deleteAccountForm.js index 7e252be860..f5c375ad85 100644 --- a/src/views/userSettings/components/deleteAccountForm.js +++ b/src/views/userSettings/components/deleteAccountForm.js @@ -21,6 +21,7 @@ import { SERVER_URL } from 'src/api/constants'; import Link from 'src/components/link'; import { Loading } from 'src/components/loading'; import { track, events } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; type State = { isLoading: boolean, @@ -31,7 +32,7 @@ type State = { type Props = { isLoading: boolean, deleteCurrentUser: Function, - dispatch: Function, + dispatch: Dispatch, data: { user: GetUserCommunityConnectionType, }, diff --git a/src/views/userSettings/components/editForm.js b/src/views/userSettings/components/editForm.js index 7f6fbae9d5..e0b971697e 100644 --- a/src/views/userSettings/components/editForm.js +++ b/src/views/userSettings/components/editForm.js @@ -37,6 +37,7 @@ import { } from 'src/helpers/images'; import { Notice } from 'src/components/listItems/style'; import { SectionCard, SectionTitle } from 'src/components/settingsViews/style'; +import type { Dispatch } from 'redux'; type State = { website: ?string, @@ -58,7 +59,7 @@ type State = { type Props = { currentUser: Object, - dispatch: Function, + dispatch: Dispatch, client: Object, editUser: Function, }; diff --git a/src/views/userSettings/components/emailSettings.js b/src/views/userSettings/components/emailSettings.js index 72caec0133..6001ac120b 100644 --- a/src/views/userSettings/components/emailSettings.js +++ b/src/views/userSettings/components/emailSettings.js @@ -17,6 +17,7 @@ import { EmailListItem, CheckboxContent } from '../style'; import type { GetCurrentUserSettingsType } from 'shared/graphql/queries/user/getCurrentUserSettings'; import UserEmailConfirmation from 'src/components/userEmailConfirmation'; import { SectionCard, SectionTitle } from 'src/components/settingsViews/style'; +import type { Dispatch } from 'redux'; const parseNotificationTypes = notifications => { const types = Object.keys(notifications.types).filter( @@ -80,7 +81,7 @@ const parseNotificationTypes = notifications => { type Props = { updateUserEmail: Function, - dispatch: Function, + dispatch: Dispatch, toggleNotificationSettings: Function, smallOnly: boolean, largeOnly: boolean, diff --git a/src/views/userSettings/components/notificationSettings.js b/src/views/userSettings/components/notificationSettings.js index bdf5b88117..184bf10647 100644 --- a/src/views/userSettings/components/notificationSettings.js +++ b/src/views/userSettings/components/notificationSettings.js @@ -10,6 +10,7 @@ import { ListContainer, Notice } from 'src/components/listItems/style'; import { SectionCard, SectionTitle } from 'src/components/settingsViews/style'; import { EmailListItem } from '../style'; import { track, events } from 'src/helpers/analytics'; +import type { Dispatch } from 'redux'; type State = { webPushBlocked: boolean, @@ -18,7 +19,7 @@ type State = { type Props = { subscribeToWebPush: Function, - dispatch: Function, + dispatch: Dispatch, smallOnly?: boolean, largeOnly?: boolean, }; diff --git a/src/views/userSettings/components/recurringPaymentsList.js b/src/views/userSettings/components/recurringPaymentsList.js index 5ee316c910..6e31f2f278 100644 --- a/src/views/userSettings/components/recurringPaymentsList.js +++ b/src/views/userSettings/components/recurringPaymentsList.js @@ -12,9 +12,10 @@ import type { GetCurrentUserRecurringPaymentsType } from 'shared/graphql/queries import { displayLoadingCard } from 'src/components/loading'; import { ListContainer } from 'src/components/listItems/style'; import { SectionCard, SectionTitle } from 'src/components/settingsViews/style'; +import type { Dispatch } from 'redux'; type Props = { - dispatch: Function, + dispatch: Dispatch, data: { user: GetCurrentUserRecurringPaymentsType, },