Group settings: on block and leave, don't delete
This commit is contained in:
parent
4978fae69c
commit
3face767aa
6 changed files with 26 additions and 29 deletions
|
@ -68,8 +68,8 @@ const createProps = (hasGroupLink = false): Props => ({
|
|||
updateGroupAttributes: async () => {
|
||||
action('updateGroupAttributes')();
|
||||
},
|
||||
onBlockAndDelete: action('onBlockAndDelete'),
|
||||
onDelete: action('onDelete'),
|
||||
onBlock: action('onBlock'),
|
||||
onLeave: action('onLeave'),
|
||||
});
|
||||
|
||||
story.add('Basic', () => {
|
||||
|
|
|
@ -55,8 +55,8 @@ export type StateProps = {
|
|||
title?: string;
|
||||
}>
|
||||
) => Promise<void>;
|
||||
onBlockAndDelete: () => void;
|
||||
onDelete: () => void;
|
||||
onBlock: () => void;
|
||||
onLeave: () => void;
|
||||
};
|
||||
|
||||
export type Props = StateProps;
|
||||
|
@ -78,8 +78,8 @@ export const ConversationDetails: React.ComponentType<Props> = ({
|
|||
showPendingInvites,
|
||||
showLightboxForMedia,
|
||||
updateGroupAttributes,
|
||||
onBlockAndDelete,
|
||||
onDelete,
|
||||
onBlock,
|
||||
onLeave,
|
||||
}) => {
|
||||
const [modalState, setModalState] = useState<ModalState>(
|
||||
ModalState.NothingOpen
|
||||
|
@ -301,8 +301,8 @@ export const ConversationDetails: React.ComponentType<Props> = ({
|
|||
i18n={i18n}
|
||||
cannotLeaveBecauseYouAreLastAdmin={cannotLeaveBecauseYouAreLastAdmin}
|
||||
conversationTitle={conversation.title}
|
||||
onDelete={onDelete}
|
||||
onBlockAndDelete={onBlockAndDelete}
|
||||
onLeave={onLeave}
|
||||
onBlock={onBlock}
|
||||
/>
|
||||
|
||||
{modalNode}
|
||||
|
|
|
@ -28,8 +28,8 @@ const createProps = (overrideProps: Partial<Props> = {}): Props => ({
|
|||
? overrideProps.cannotLeaveBecauseYouAreLastAdmin
|
||||
: false,
|
||||
conversationTitle: overrideProps.conversationTitle || '',
|
||||
onBlockAndDelete: action('onBlockAndDelete'),
|
||||
onDelete: action('onDelete'),
|
||||
onBlock: action('onBlock'),
|
||||
onLeave: action('onLeave'),
|
||||
i18n,
|
||||
});
|
||||
|
||||
|
|
|
@ -15,16 +15,16 @@ import { ConversationDetailsIcon } from './ConversationDetailsIcon';
|
|||
export type Props = {
|
||||
cannotLeaveBecauseYouAreLastAdmin: boolean;
|
||||
conversationTitle: string;
|
||||
onBlockAndDelete: () => void;
|
||||
onDelete: () => void;
|
||||
onBlock: () => void;
|
||||
onLeave: () => void;
|
||||
i18n: LocalizerType;
|
||||
};
|
||||
|
||||
export const ConversationDetailsActions: React.ComponentType<Props> = ({
|
||||
cannotLeaveBecauseYouAreLastAdmin,
|
||||
conversationTitle,
|
||||
onBlockAndDelete,
|
||||
onDelete,
|
||||
onBlock,
|
||||
onLeave,
|
||||
i18n,
|
||||
}) => {
|
||||
const [confirmingLeave, setConfirmingLeave] = React.useState<boolean>(false);
|
||||
|
@ -94,7 +94,7 @@ export const ConversationDetailsActions: React.ComponentType<Props> = ({
|
|||
text: i18n(
|
||||
'ConversationDetailsActions--leave-group-modal-confirm'
|
||||
),
|
||||
action: onDelete,
|
||||
action: onLeave,
|
||||
style: 'affirmative',
|
||||
},
|
||||
]}
|
||||
|
@ -113,7 +113,7 @@ export const ConversationDetailsActions: React.ComponentType<Props> = ({
|
|||
text: i18n(
|
||||
'ConversationDetailsActions--block-group-modal-confirm'
|
||||
),
|
||||
action: onBlockAndDelete,
|
||||
action: onBlock,
|
||||
style: 'affirmative',
|
||||
},
|
||||
]}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue