mattermost-mobile/app/screens/home/search/initial/modifiers/show_more.tsx
Avinash Lingaloo e443a69265
MM-45344 Gekidou Remove <MenuItem/> (#6522)
* 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
2022-08-04 12:26:27 +04:00

51 lines
1.3 KiB
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';
import {useTheme} from '@context/theme';
import {t} from '@i18n';
import {makeStyleSheetFromTheme} from '@utils/theme';
import {typography} from '@utils/typography';
type ShowMoreButtonProps = {
onPress: () => void;
showMore: boolean;
}
const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => {
return {
showMore: {
color: theme.buttonBg,
paddingLeft: 20,
...typography('Body', 200, 'SemiBold'),
},
};
});
const ShowMoreButton = ({onPress, showMore}: ShowMoreButtonProps) => {
const theme = useTheme();
const intl = useIntl();
const styles = getStyleSheet(theme);
let id = t('mobile.search.show_more');
let defaultMessage = 'Show more';
if (showMore) {
id = t('mobile.search.show_less');
defaultMessage = 'Show less';
}
return (
<OptionItem
action={onPress}
testID={'mobile.search.show_more'}
type='default'
label={intl.formatMessage({id, defaultMessage})}
optionLabelTextStyle={styles.showMore}
/>
);
};
export default ShowMoreButton;