forked from Ivasoft/mattermost-mobile
pass props to child component since they already exist in the parent
This commit is contained in:
@@ -31,6 +31,7 @@ const messages = defineMessages({
|
||||
type Props = {
|
||||
componentId: string;
|
||||
currentTeamId: string;
|
||||
currentUserId: string;
|
||||
restrictDirectMessage: boolean;
|
||||
teammateNameDisplay: string;
|
||||
}
|
||||
@@ -38,6 +39,7 @@ type Props = {
|
||||
export default function CreateDirectMessage({
|
||||
componentId,
|
||||
currentTeamId,
|
||||
currentUserId,
|
||||
restrictDirectMessage,
|
||||
teammateNameDisplay,
|
||||
}: Props) {
|
||||
@@ -93,6 +95,7 @@ export default function CreateDirectMessage({
|
||||
<MembersModal
|
||||
buttonText={messages.button}
|
||||
componentId={componentId}
|
||||
currentUserId={currentUserId}
|
||||
getProfiles={getProfiles}
|
||||
maxSelectedUsers={General.MAX_USERS_IN_GM}
|
||||
page={page}
|
||||
@@ -100,6 +103,7 @@ export default function CreateDirectMessage({
|
||||
selectedIds={selectedIds}
|
||||
setPage={setPage}
|
||||
setSelectedIds={setSelectedIds}
|
||||
teammateNameDisplay={teammateNameDisplay}
|
||||
onButtonTap={onButtonTap}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -1,23 +1,14 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {withDatabase} from '@nozbe/watermelondb/DatabaseProvider';
|
||||
import withObservables from '@nozbe/with-observables';
|
||||
|
||||
import {observeProfileLongPresTutorial} from '@queries/app/global';
|
||||
import {observeCurrentUserId} from '@queries/servers/system';
|
||||
import {observeTeammateNameDisplay} from '@queries/servers/user';
|
||||
|
||||
import MembersModal from './members_modal';
|
||||
|
||||
import type {WithDatabaseArgs} from '@typings/database/database';
|
||||
const enhanced = withObservables([], () => ({
|
||||
tutorialWatched: observeProfileLongPresTutorial(),
|
||||
}));
|
||||
|
||||
const enhanced = withObservables([], ({database}: WithDatabaseArgs) => {
|
||||
return {
|
||||
teammateNameDisplay: observeTeammateNameDisplay(database),
|
||||
currentUserId: observeCurrentUserId(database),
|
||||
tutorialWatched: observeProfileLongPresTutorial(),
|
||||
};
|
||||
});
|
||||
|
||||
export default withDatabase(enhanced(MembersModal));
|
||||
export default enhanced(MembersModal);
|
||||
|
||||
Reference in New Issue
Block a user