Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(entity): use interactor for conversation
Signed-off-by: Godefroy Ponsinet <godefroy.ponsinet@outlook.com>
- Loading branch information
Showing
28 changed files
with
842 additions
and
656 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
47 changes: 47 additions & 0 deletions
47
client/react-native/common/components/Library/ContactIdentityActions/ActionsUnknown.js
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,47 @@ | ||
import React from 'react' | ||
import { colors } from '../../../constants' | ||
import ActionList from './ActionList' | ||
import RelayContext from '../../../relay/RelayContext' | ||
import { withNamespaces } from 'react-i18next' | ||
|
||
const ActionsUnknown = ({ data, inModal, t }) => ( | ||
<RelayContext.Consumer> | ||
{({ mutations }) => ( | ||
<ActionList inModal={inModal}> | ||
<ActionList.Action | ||
icon={'send'} | ||
color={colors.green} | ||
title={t('contacts.request-action')} | ||
dismissOnSuccess | ||
action={() => { | ||
const contact = Object.keys(data) | ||
.filter(key => key.substring(0, 2) !== '__') | ||
.reduce( | ||
(acc, key) => ({ | ||
...acc, | ||
[key]: data[key], | ||
}), | ||
{} | ||
) | ||
return mutations.contactRequest({ | ||
contactId: contact.id, | ||
contactOverrideDisplayName: | ||
contact.overrideDisplayName || contact.displayName || '', | ||
introText: '', | ||
}) | ||
}} | ||
successMessage={t('contacts.request-action-feedback')} | ||
/> | ||
<ActionList.Action | ||
icon={'x'} | ||
color={colors.white} | ||
title={inModal ? t('contacts.cancel-request-action') : null} | ||
action={() => mutations.contactRemove({ id: data.id })} | ||
successMessage={t('contacts.cancel-request-action-feedback')} | ||
/> | ||
</ActionList> | ||
)} | ||
</RelayContext.Consumer> | ||
) | ||
|
||
export default withNamespaces()(ActionsUnknown) |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.