Skip to content

Commit

Permalink
chore(Helmet): Use helmet instead of document.title to change title
Browse files Browse the repository at this point in the history
  • Loading branch information
qgerome committed Oct 8, 2021
1 parent 393dd2b commit e2e49fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/components/MedicalItemForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
coreConfirm,
ErrorBoundary,
Form,
Helmet,
formatMessageWithValues,
historyPush,
journalize,
Expand Down Expand Up @@ -40,7 +41,6 @@ class MedicalItemForm extends Component {
}

componentDidMount() {
document.title = formatMessageWithValues(this.props.intl, "medical.item", "overviewTitle", { label: "" });
if (this.props.medicalItemId) {
this.setState(
(state, props) => ({ medicalItemId: props.medicalItemId }),
Expand Down Expand Up @@ -179,6 +179,7 @@ class MedicalItemForm extends Component {
];
return (
<div className={runningMutation ? classes.lockedPage : null}>
<Helmet title={formatMessageWithValues(this.props.intl, "medical.item", "MedicalItemOverview.title")} />
<ProgressOrError progress={fetchingMedicalItem} error={errorMedicalItem} />
<ErrorBoundary>
{((!!fetchedMedicalItem && !!medicalItem && medicalItem.uuid === medicalItemId) || !medicalItemId) && (
Expand Down
5 changes: 2 additions & 3 deletions src/components/MedicalServiceForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { withStyles, withTheme } from "@material-ui/core/styles";
import ReplayIcon from "@material-ui/icons/Replay";
import {
coreConfirm,
Helmet,
ErrorBoundary,
Form,
formatMessageWithValues,
Expand Down Expand Up @@ -39,9 +40,6 @@ class MedicalServiceForm extends Component {
}

componentDidMount() {
document.title = formatMessageWithValues(this.props.intl, "medical.service", "MedicalServiceOverview.title", {
label: "",
});
if (this.props.medicalServiceId) {
this.setState(
(state, props) => ({ medicalServiceId: props.medicalServiceId }),
Expand Down Expand Up @@ -174,6 +172,7 @@ class MedicalServiceForm extends Component {
];
return (
<div className={lockNew ? classes.lockedPage : null}>
<Helmet title={formatMessageWithValues(this.props.intl, "medical.service", "MedicalServiceOverview.title")} />
<ProgressOrError progress={fetchingMedicalService} error={errorMedicalService} />
<ErrorBoundary>
{((!!fetchedMedicalService && !!medicalService && medicalService.uuid === medicalServiceId) ||
Expand Down

0 comments on commit e2e49fb

Please sign in to comment.