-
-
Notifications
You must be signed in to change notification settings - Fork 665
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
android: Receive and handle shares from other apps.
Enables handling and receiving shares from other apps, for any type of content (text, images, and other files). Uses the new root component, `SharingRoot` and the new native module `SharingModule`. Introduces a new route for sharing - `SharingScreen` allowing sharing content via PMs or to Streams. `react-navigation` code Suggested-by: Chris Bobbe <[email protected]> Closes #M117.
- Loading branch information
Showing
10 changed files
with
642 additions
and
7 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
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,44 @@ | ||
/* @flow strict-local */ | ||
import React, { PureComponent } from 'react'; | ||
import type { User, Dispatch } from '../types'; | ||
import { connect } from '../react-redux'; | ||
import { Screen } from '../common'; | ||
import UserPickerCard from '../user-picker/UserPickerCard'; | ||
|
||
type Props = $ReadOnly<{| | ||
dispatch: Dispatch, | ||
onComplete: (User[]) => void, | ||
|}>; | ||
|
||
type State = {| | ||
filter: string, | ||
|}; | ||
|
||
class ChooseRecipientsScreen extends PureComponent<Props, State> { | ||
state = { | ||
filter: '', | ||
}; | ||
|
||
handleFilterChange = (filter: string) => this.setState({ filter }); | ||
|
||
handleComplete = (selected: Array<User>) => { | ||
const { onComplete } = this.props; | ||
onComplete(selected); | ||
}; | ||
|
||
render() { | ||
const { filter } = this.state; | ||
return ( | ||
<Screen | ||
search | ||
scrollEnabled={false} | ||
searchBarOnChange={this.handleFilterChange} | ||
canGoBack={false} | ||
> | ||
<UserPickerCard filter={filter} onComplete={this.handleComplete} /> | ||
</Screen> | ||
); | ||
} | ||
} | ||
|
||
export default connect<{||}, _, _>()(ChooseRecipientsScreen); |
Oops, something went wrong.