Skip to content

Commit

Permalink
LegalScreen: Put policies URL on "Zulip terms" line
Browse files Browse the repository at this point in the history
Since the realms' individual policy URLs are shown (really just to
disambiguate different realms with the same name) it looks a bit odd
if the "Zulip terms" line doesn't have a URL, so add it.
  • Loading branch information
chrisbobbe committed Mar 11, 2023
1 parent 6df6dab commit e72df8b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/settings/LegalScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ type Props = $ReadOnly<{|
route: RouteProp<'legal', void>,
|}>;

const zulipPoliciesUrl = new URL('https://zulip.com/policies/?nav=no');

/**
* A global, all-accounts screen linking to terms for all realms we know about.
*/
Expand All @@ -81,12 +83,17 @@ export default function LegalScreen(props: Props): Node {
const globalSettings = useGlobalSelector(getGlobalSettings);

const openZulipPolicies = useCallback(() => {
openLinkWithUserPreference(new URL('https://zulip.com/policies/?nav=no'), globalSettings);
openLinkWithUserPreference(zulipPoliciesUrl, globalSettings);
}, [globalSettings]);

return (
<Screen title="Legal">
<NavRow title="Zulip terms" onPress={openZulipPolicies} type="external" />
<NavRow
title="Zulip terms"
subtitle={{ text: '{_}', values: { _: zulipPoliciesUrl.toString() } }}
onPress={openZulipPolicies}
type="external"
/>
{viewModel.map(({ realm, name, policiesUrl }) => (
<NavRow
key={realm.toString()}
Expand Down

0 comments on commit e72df8b

Please sign in to comment.