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 Apr 6, 2023
1 parent dea832f commit a5123e9
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 a5123e9

Please sign in to comment.