-
-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor UserList and ComposeBox (#1002)
- Loading branch information
1 parent
4ef158d
commit 47bfb9c
Showing
11 changed files
with
99 additions
and
66 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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* @flow */ | ||
import { connect } from 'react-redux'; | ||
|
||
import type { GlobalState } from '../types'; | ||
import boundActions from '../boundActions'; | ||
import { getAuth, getLastTopicInActiveNarrow } from '../selectors'; | ||
|
||
import ComposeBox from './ComposeBox'; | ||
|
||
export default connect( | ||
(state: GlobalState) => ({ | ||
auth: getAuth(state), | ||
narrow: state.chat.narrow, | ||
users: state.users, | ||
lastTopic: getLastTopicInActiveNarrow(state), | ||
editMessage: state.app.editMessage, | ||
}), | ||
boundActions, | ||
)(ComposeBox); |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* @flow */ | ||
import React from 'react'; | ||
import { StyleSheet, View } from 'react-native'; | ||
import { connect } from 'react-redux'; | ||
import { connectActionSheet, ActionSheetProvider } from '@expo/react-native-action-sheet'; | ||
|
||
import { getAuth } from '../selectors'; | ||
import boundActions from '../boundActions'; | ||
import ComposeMenu from './ComposeMenu'; | ||
|
||
const ConnectedComposeMenu = connectActionSheet(ComposeMenu); | ||
|
||
const componentStyles = StyleSheet.create({ | ||
wrapper: { | ||
height: 44, | ||
}, | ||
}); | ||
|
||
export default connect( | ||
state => ({ | ||
auth: getAuth(state), | ||
isHydrated: state.app.isHydrated, | ||
needsInitialFetch: state.app.needsInitialFetch, | ||
}), | ||
boundActions, | ||
)(props => | ||
<View style={componentStyles.wrapper}> | ||
<ActionSheetProvider> | ||
<ConnectedComposeMenu {...props} /> | ||
</ActionSheetProvider> | ||
</View>, | ||
); |
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
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
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