Set descriptive document titles

Document titles represent the pages, for example in lists
with bookmarks. They are important for navigation and
orientation in websites. If the offer or the content of the
page is not labeled, orientation is impaired.

This changes the behavior for setting document titles.
The functionality has been removed from the Page and
Title components and is now represented by `useDocumentTitle`
hook to better describe the content of inividual pages.

Co-authored-by: Anna Vetcininova<anna.vetcininova@cloudogu.com>
This commit is contained in:
Florian Scholdei
2024-12-10 16:41:01 +01:00
parent 3ed457a891
commit 3c0ad46f07
74 changed files with 812 additions and 445 deletions

View File

@@ -14,25 +14,26 @@
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
import React from "react";
import { WithTranslation, withTranslation } from "react-i18next";
import { Title, Configuration } from "@scm-manager/ui-components";
import React, { FC } from "react";
import { useTranslation } from "react-i18next";
import { Configuration } from "@scm-manager/ui-components";
import { Title, useDocumentTitle } from "@scm-manager/ui-core";
import SvnConfigurationForm from "./SvnConfigurationForm";
type Props = WithTranslation & {
type Props = {
link: string;
};
class SvnGlobalConfiguration extends React.Component<Props> {
render() {
const { link, t } = this.props;
return (
<div>
<Title title={t("scm-svn-plugin.config.title")} />
<Configuration link={link} render={(props: any) => <SvnConfigurationForm {...props} />} />
</div>
);
}
}
const SvnGlobalConfiguration: FC<Props> = ({ link }) => {
const [t] = useTranslation("plugins");
useDocumentTitle(t("scm-svn-plugin.config.title"));
export default withTranslation("plugins")(SvnGlobalConfiguration);
return (
<div>
<Title>{t("scm-svn-plugin.config.title")}</Title>
<Configuration link={link} render={(props: any) => <SvnConfigurationForm {...props} />} />
</div>
);
};
export default SvnGlobalConfiguration;