Skip to content

Commit

Permalink
fix: page title split
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Jul 7, 2020
1 parent 81f0b12 commit 0206483
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ui/app/src/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface AppProps {
* application container component. adds SEO, SkipLinks, Header and Footer.
*
*/
export const App: FC<AppProps> = ({ title, children }) => {
export const App: FC<AppProps> = ({ title = '', children }) => {
const { storeProvider, docId } = useContext(BlockContext);
const doc = docId ? storeProvider.getStoryDoc(docId) : undefined;
const { toolbar } = storeProvider.config || {};
Expand All @@ -38,10 +38,11 @@ export const App: FC<AppProps> = ({ title, children }) => {
text: 'skip to context sidebar',
});
}

const titleParts = title.split('/');
const pageTitle = titleParts[titleParts.length - 1];
return (
<Fragment>
<SEO title={title} />
<SEO title={pageTitle} />
<SkipLinks items={items} />
<Box variant="app">
<Header toolbar={toolbar} />
Expand Down

0 comments on commit 0206483

Please sign in to comment.