From dc64c7b8ab4666286d0a7e09837ad92c340a9bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20R=C3=A4dle?= Date: Fri, 5 Aug 2022 18:40:36 -0700 Subject: [PATCH] Better Expo/example wrapper title (#102) Summary: Pull Request resolved: https://github.com/facebookresearch/playtorch/pull/102 Changing the document title for the Expo and example wrapper pages to show the Expo Snack slug or the example slug in the page title rather than a generic page title. Reviewed By: chrisklaiber Differential Revision: D38477091 fbshipit-source-id: 750f68db4445bf197220d8a7fe351dcd247940d4 --- website/src/components/ExampleLandingPage.js | 5 ++++- website/src/components/ExpoSnackLandingPage.js | 9 ++++++--- website/src/components/LandingPageHeader.js | 3 ++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/website/src/components/ExampleLandingPage.js b/website/src/components/ExampleLandingPage.js index a4c65df28..89311b225 100644 --- a/website/src/components/ExampleLandingPage.js +++ b/website/src/components/ExampleLandingPage.js @@ -7,7 +7,8 @@ * @format */ -import React from 'react'; +import Head from '@docusaurus/Head'; +import * as React from 'react'; import {useEffect} from 'react'; import LandingPageHeader from './LandingPageHeader'; @@ -30,7 +31,9 @@ export default function ExampleLandingPage({match, history}) { return (
+ diff --git a/website/src/components/ExpoSnackLandingPage.js b/website/src/components/ExpoSnackLandingPage.js index 6315689d4..3ae83e346 100644 --- a/website/src/components/ExpoSnackLandingPage.js +++ b/website/src/components/ExpoSnackLandingPage.js @@ -7,12 +7,13 @@ * @format */ -import React from 'react'; -import clsx from 'clsx'; +import Head from '@docusaurus/Head'; import ExpoSnack from '@site/src/components/ExpoSnack'; +import clsx from 'clsx'; +import * as React from 'react'; import styles from './ExpoSnackLandingPage.module.css'; -import RedirectStarterSnack from './RedirectStarterSnack'; import LandingPageHeader from './LandingPageHeader'; +import RedirectStarterSnack from './RedirectStarterSnack'; export default function ExpoSnackLandingPage({match}) { const {expoSnackPath} = match.params; @@ -23,7 +24,9 @@ export default function ExpoSnackLandingPage({match}) { return (
+ diff --git a/website/src/components/LandingPageHeader.js b/website/src/components/LandingPageHeader.js index abab72d63..7ccb5a66c 100644 --- a/website/src/components/LandingPageHeader.js +++ b/website/src/components/LandingPageHeader.js @@ -27,6 +27,7 @@ function AppStoreButton({href, LogoComponent, label}) { } export default function LandingPageHeader({ + heroTitle, urlToOpenInPlayTorch, nameOfSharedItem, }) { @@ -37,7 +38,7 @@ export default function LandingPageHeader({
-

PlayTorch

+

{heroTitle}

PlayTorch is a framework for rapidly creating cross-platform mobile AI experiences.