forked from Ivasoft/mattermost-mobile
* added MENU_ITEM_HEIGHT to constant/view * fix user presence and your profile * added MENU_ITEM_HEIGHT to constant/view * fix user presence and your profile * UI Polish - Custom Status * UI Polish - Settings * UI Polish - logout * refactored styles * removed 'throws DataOperatorException' from './database/` * fix for copy link option * fix autoresponder 1. user should be allowed to enter paragraph 2. the OOO was not immediately being updated on the notification main screen. The fix is to cal fetchStatusInBatch after the updateMe operation * About Screen - code clean up * removed MenuItem component from common_post_options * removed MenuItem from Settings * refactored show_more and recent_item * removed menu_item component * Update setting_container.tsx * PR review correction * Update setting_container.tsx * Update recent_item.tsx
40 lines
874 B
TypeScript
40 lines
874 B
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import React from 'react';
|
|
import {useIntl} from 'react-intl';
|
|
|
|
import OptionItem from '@components/option_item';
|
|
|
|
type BaseOptionType = {
|
|
defaultMessage: string;
|
|
i18nId: string;
|
|
iconName: string;
|
|
isDestructive?: boolean;
|
|
onPress: () => void;
|
|
testID: string;
|
|
}
|
|
|
|
const BaseOption = ({
|
|
defaultMessage,
|
|
i18nId,
|
|
iconName,
|
|
isDestructive = false,
|
|
onPress,
|
|
testID,
|
|
}: BaseOptionType) => {
|
|
const intl = useIntl();
|
|
|
|
return (
|
|
<OptionItem
|
|
action={onPress}
|
|
destructive={isDestructive}
|
|
icon={iconName}
|
|
label={intl.formatMessage({id: i18nId, defaultMessage})}
|
|
testID={testID}
|
|
type='default'
|
|
/>
|
|
);
|
|
};
|
|
export default BaseOption;
|