Move 'public branding' option to Settings -> Details

This commit is contained in:
Tom Moor
2023-05-08 21:01:08 -04:00
parent 679a86fe6f
commit 90b13d5f27
3 changed files with 27 additions and 19 deletions

View File

@@ -7,7 +7,7 @@ import * as React from "react";
import { useTranslation, Trans } from "react-i18next";
import { ThemeProvider, useTheme } from "styled-components";
import { buildDarkTheme, buildLightTheme } from "@shared/styles/theme";
import { CustomTheme } from "@shared/types";
import { CustomTheme, TeamPreference } from "@shared/types";
import { getBaseDomain } from "@shared/utils/domains";
import Button from "~/components/Button";
import ButtonLink from "~/components/ButtonLink";
@@ -16,6 +16,7 @@ import Heading from "~/components/Heading";
import Input from "~/components/Input";
import InputColor from "~/components/InputColor";
import Scene from "~/components/Scene";
import Switch from "~/components/Switch";
import Text from "~/components/Text";
import env from "~/env";
import useCurrentTeam from "~/hooks/useCurrentTeam";
@@ -40,6 +41,9 @@ function Details() {
);
const [name, setName] = useState(team.name);
const [subdomain, setSubdomain] = useState(team.subdomain);
const [publicBranding, setPublicBranding] = useState(
team.preferences?.publicBranding
);
const [defaultCollectionId, setDefaultCollectionId] = useState<string | null>(
team.defaultCollectionId
);
@@ -65,6 +69,7 @@ function Details() {
defaultCollectionId,
preferences: {
...team.preferences,
publicBranding,
customTheme,
},
});
@@ -83,6 +88,7 @@ function Details() {
subdomain,
defaultCollectionId,
team.preferences,
publicBranding,
customTheme,
showToast,
t,
@@ -214,6 +220,24 @@ function Details() {
flex
/>
</SettingRow>
{team.avatarUrl && (
<SettingRow
name={TeamPreference.PublicBranding}
label={t("Public branding")}
description={t(
"Show your teams logo on public pages like login and shared documents."
)}
>
<Switch
id={TeamPreference.PublicBranding}
name={TeamPreference.PublicBranding}
checked={publicBranding}
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
setPublicBranding(event.target.checked)
}
/>
</SettingRow>
)}
<Heading as="h2">{t("Behavior")}</Heading>

View File

@@ -69,22 +69,6 @@ function Features() {
onChange={handlePreferenceChange}
/>
</SettingRow>
{team.avatarUrl && (
<SettingRow
name={TeamPreference.PublicBranding}
label={t("Public branding")}
description={t(
"Show your teams logo on public pages like login and shared documents."
)}
>
<Switch
id={TeamPreference.PublicBranding}
name={TeamPreference.PublicBranding}
checked={team.getPreference(TeamPreference.PublicBranding)}
onChange={handlePreferenceChange}
/>
</SettingRow>
)}
</Scene>
);
}

View File

@@ -727,6 +727,8 @@
"Reset theme": "Reset theme",
"Accent color": "Accent color",
"Accent text color": "Accent text color",
"Public branding": "Public branding",
"Show your teams logo on public pages like login and shared documents.": "Show your teams logo on public pages like login and shared documents.",
"Behavior": "Behavior",
"Subdomain": "Subdomain",
"Your knowledge base will be accessible at": "Your knowledge base will be accessible at",
@@ -742,8 +744,6 @@
"When enabled documents are always editable for team members that have permission. When disabled there is a separate editing view.": "When enabled documents are always editable for team members that have permission. When disabled there is a separate editing view.",
"Commenting": "Commenting",
"When enabled team members can add comments to documents.": "When enabled team members can add comments to documents.",
"Public branding": "Public branding",
"Show your teams logo on public pages like login and shared documents.": "Show your teams logo on public pages like login and shared documents.",
"Add a Google Analytics 4 measurement ID to send document views and analytics from the workspace to your own Google Analytics account.": "Add a Google Analytics 4 measurement ID to send document views and analytics from the workspace to your own Google Analytics account.",
"Measurement ID": "Measurement ID",
"Create a \"Web\" stream in your Google Analytics admin dashboard and copy the measurement ID from the generated code snippet to install.": "Create a \"Web\" stream in your Google Analytics admin dashboard and copy the measurement ID from the generated code snippet to install.",