Clean up local config (#6804)

This commit is contained in:
Elias Nahum
2022-11-30 18:20:29 +02:00
committed by GitHub
parent 0f8798ca55
commit 7a478ec11d
3 changed files with 16 additions and 37 deletions

View File

@@ -118,15 +118,11 @@ const About = ({config, license}: AboutProps) => {
}, []);
const handleAboutTeam = useCallback(preventDoubleTap(() => {
return openURL(Config.AboutTeamURL);
}), []);
const handleAboutEnterprise = useCallback(preventDoubleTap(() => {
return openURL(Config.AboutEnterpriseURL);
return openURL(Config.WebsiteURL);
}), []);
const handlePlatformNotice = useCallback(preventDoubleTap(() => {
return openURL(Config.PlatformNoticeURL);
return openURL(Config.ServerNoticeURL);
}), []);
const handleMobileNotice = useCallback(preventDoubleTap(() => {
@@ -256,8 +252,7 @@ const About = ({config, license}: AboutProps) => {
)}
<LearnMore
config={config}
onHandleAboutEnterprise={handleAboutEnterprise}
onHandleAboutTeam={handleAboutTeam}
onPress={handleAboutTeam}
/>
{!MATTERMOST_BUNDLE_IDS.includes(DeviceInfo.getBundleId()) &&
<FormattedText

View File

@@ -31,24 +31,20 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
type LearnMoreProps = {
config: ClientConfig;
onHandleAboutEnterprise: () => void;
onHandleAboutTeam: () => void;
onPress: () => void;
};
const LearnMore = ({config, onHandleAboutEnterprise, onHandleAboutTeam}: LearnMoreProps) => {
const LearnMore = ({config, onPress}: LearnMoreProps) => {
const theme = useTheme();
const style = getStyleSheet(theme);
let id = t('about.teamEditionLearn');
let defaultMessage = 'Join the Mattermost community at ';
let onPress = onHandleAboutTeam;
let url = Config.TeamEditionLearnURL;
const url = Config.WebsiteURL;
if (config.BuildEnterpriseReady === 'true') {
id = t('about.enterpriseEditionLearn');
defaultMessage = 'Learn more about Enterprise Edition at ';
onPress = onHandleAboutEnterprise;
url = Config.EELearnURL;
}
return (