Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions packages/client/src/interface/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,27 @@ const SeparatedColumn = styled(Column, {
},
});

/**
* Legal links footer row
*/
const LegalLinks = styled("div", {
base: {
display: "flex",
gap: "var(--gap-lg)",
fontSize: "0.8em",
color: "var(--md-sys-color-on-surface-variant)",

"& a": {
color: "inherit",
textDecoration: "none",

"&:hover": {
textDecoration: "underline",
},
},
},
});

/**
* Home page
*/
Expand All @@ -100,6 +121,13 @@ export function HomePage() {
const isInLounge =
client()!.servers.get("01F7ZSBSFHQ8TA81725KQCSDDP") !== undefined;

const isLegalLinksAvailable = () => {
if (client().configured()) {
return client().configuration?.features.legal_links !== undefined;
}
return false;
};

return (
<Base>
<Header placement="primary">
Expand Down Expand Up @@ -228,6 +256,51 @@ export function HomePage() {
</CategoryButton>
</SeparatedColumn>
</Buttons>
<Show when={isLegalLinksAvailable()}>
<LegalLinks>
<Show
when={
client()!.configuration?.features.legal_links.terms_of_service
}
>
<a
href={
client()!.configuration?.features.legal_links.terms_of_service
}
target="_blank"
rel="noopener noreferrer"
>
<Trans>Terms of Service</Trans>
</a>
</Show>
<Show
when={
client()!.configuration?.features.legal_links.privacy_policy
}
>
<a
href={
client()!.configuration?.features.legal_links.privacy_policy
}
target="_blank"
rel="noopener noreferrer"
>
<Trans>Privacy Policy</Trans>
</a>
</Show>
<Show
when={client()!.configuration?.features.legal_links.guidelines}
>
<a
href={client()!.configuration?.features.legal_links.guidelines}
target="_blank"
rel="noopener noreferrer"
>
<Trans>Community Guidelines</Trans>
</a>
</Show>
</LegalLinks>
</Show>
<Show when={IS_DEV}>
<Button onPress={() => navigate("/dev")}>
Open Development Page
Expand Down
Loading