mattermost-mobile/app/screens/settings/about/tos_privacy.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

71 lines
2.2 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import {Text} from 'react-native';
import FormattedText from '@components/formatted_text';
import {useTheme} from '@context/theme';
import {t} from '@i18n';
import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';
import {typography} from '@utils/typography';
const getStyleSheet = makeStyleSheetFromTheme((theme) => {
return {
noticeLink: {
color: theme.linkColor,
...typography('Body', 50),
},
footerText: {
color: changeOpacity(theme.centerChannelColor, 0.5),
...typography('Body', 50),
marginBottom: 10,
},
hyphenText: {
marginBottom: 0,
},
};
});
type TosPrivacyContainerProps = {
config: ClientConfig;
onPressTOS: () => void;
onPressPrivacyPolicy: () => void;
}
const TosPrivacyContainer = ({config, onPressTOS, onPressPrivacyPolicy}: TosPrivacyContainerProps) => {
const theme = useTheme();
const style = getStyleSheet(theme);
const hasTermsOfServiceLink = Boolean(config.TermsOfServiceLink);
const hasPrivacyPolicyLink = Boolean(config.PrivacyPolicyLink);
return (
<>
{hasTermsOfServiceLink && (
<FormattedText
id={t('mobile.tos_link')}
defaultMessage='Terms of Service'
style={style.noticeLink}
onPress={onPressTOS}
testID='about.terms_of_service'
/>
)}
{hasTermsOfServiceLink && hasPrivacyPolicyLink && (
<Text style={[style.footerText, style.hyphenText]}>
{' - '}
</Text>
)}
{hasPrivacyPolicyLink && (
<FormattedText
id={t('mobile.privacy_link')}
defaultMessage='Privacy Policy'
style={style.noticeLink}
onPress={onPressPrivacyPolicy}
testID='about.privacy_policy'
/>
)}
</>
);
};
export default TosPrivacyContainer;