Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#Vulcan-283/Dynamic browser tab titles. #613

Closed
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"react-force-graph-2d": "^1.23.8",
"react-gauge-chart": "^0.4.1",
"react-grid-layout": "^1.3.4",
"react-helmet-async": "^1.3.0",
"react-leaflet": "^3.2.5",
"react-leaflet-cluster": "^1.0.4",
"react-leaflet-enhanced-marker": "^1.0.21",
Expand Down
10 changes: 10 additions & 0 deletions src/component/page/PageHeader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import { Helmet } from 'react-helmet-async';

export default function PageHeader({ title = 'NeoDash - Neo4j Dashboard Builder' }) {
return (
<Helmet>
<title>{title}</title>
</Helmet>
);
}
2 changes: 2 additions & 0 deletions src/dashboard/header/DashboardTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import NeoExtensionsModal from '../../extensions/ExtensionsModal';
import { EXTENSIONS_DRAWER_BUTTONS } from '../../extensions/ExtensionConfig';

import { Tooltip } from '@mui/material';
import PageHeader from '../../component/page/PageHeader';

export const NeoDashboardTitle = ({
dashboardTitle,
Expand Down Expand Up @@ -101,6 +102,7 @@ export const NeoDashboardTitle = ({
</div>
) : (
<div className={'n-flex n-flex-row n-flex-wrap n-justify-between n-items-center'}>
<PageHeader title={dashboardTitle || 'NeoDash - Neo4j Dashboard Builder'} />
<Typography variant='h3'>{dashboardTitle}</Typography>
<Tooltip title={'Edit'} disableInteractive>
{editable ? (
Expand Down
5 changes: 4 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import '/node_modules/react-resizable/css/styles.css';
import './index.pcss';
import StyleConfig from './config/StyleConfig';
import * as Sentry from '@sentry/react';
import { HelmetProvider } from 'react-helmet-async';

if (window.location.href.includes('//neodash.graphapp.io/')) {
Sentry.init({
Expand Down Expand Up @@ -45,7 +46,9 @@ await StyleConfig.getInstance();
const provider = (
<ReduxProvider store={store}>
<PersistGate persistor={persister} loading={<div>Loading NeoDash...</div>}>
<Application />
<HelmetProvider>
<Application />
</HelmetProvider>
</PersistGate>
</ReduxProvider>
);
Expand Down