chat: updated Leave Group copy

This commit is contained in:
Tyler Brown Cifu Shuster 2020-08-21 16:14:10 -07:00
parent 94151b4a8f
commit c383d31c24
2 changed files with 52 additions and 47 deletions

View File

@ -1,8 +1,6 @@
import React, { Component } from 'react';
import React, { memo } from 'react';
export const DeleteButton = (props) => {
const { isOwner, station, changeLoading, api } = props;
export const DeleteButton = memo(({ isOwner, station, changeLoading, association, contacts, api }) => {
const leaveButtonClasses = (!isOwner) ? 'pointer' : 'c-default';
const deleteButtonClasses = (isOwner) ?
'b--red2 red2 pointer bg-gray0-d' :
@ -19,13 +17,19 @@ export const DeleteButton = (props) => {
);
};
const groupPath = association['group-path'];
const unmanagedVillage = !contacts[groupPath];
return (
<div className="w-100 cf">
<div className={'w-100 fl mt3 ' + ((isOwner) ? 'o-30' : '')}>
<p className="f8 mt3 lh-copy db">Leave Chat</p>
<p className="f9 gray2 db mb4">
Remove this chat from your chat list.{' '}
You will need to request for access again.
{unmanagedVillage
? 'You will need to request for access again'
: 'You will need to join again from the group page.'
}
</p>
<a onClick={(!isOwner) ? deleteChat : null}
className={
@ -47,5 +51,4 @@ export const DeleteButton = (props) => {
</div>
</div>
);
};
})

View File

@ -89,6 +89,8 @@ export class SettingsScreen extends Component {
isOwner={isOwner}
changeLoading={this.changeLoading}
station={station}
association={association}
contacts={contacts}
api={api} />
<MetadataSettings
isOwner={isOwner}