Skip to content

Commit

Permalink
fix(seo): fix seo score
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLantukh committed Jul 6, 2023
1 parent 2d8e4be commit 2274c9b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"confirm": "Yes"
},
"default_site_name": "My OTT Application",
"default_description": "JW OTT Webapp is an open-source, dynamically generated video website.",
"filter_videos_by": "Filter videos by {{name}}",
"filter_videos_by_genre": "Filter videos by genre",
"home": "Home",
Expand Down
1 change: 1 addition & 0 deletions public/locales/en/demo.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"app_config_not_found": "Invalid or Missing App Config",
"app_config_learn_more": "Learn more about the App Config creation",
"cancel_config_id": "Cancel",
"click_to_unselect_config": "(click here to unselect this config)",
"currently_previewing_config": "You are currently previewing config: '{{configSource}}'",
Expand Down
1 change: 1 addition & 0 deletions public/locales/es/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"confirm": ""
},
"default_site_name": "Mi aplicación OTT",
"default_description": "",
"filter_videos_by": "Filtrar videos por {{name}}",
"filter_videos_by_genre": "Filtrar videos por género",
"home": "Inicio",
Expand Down
1 change: 1 addition & 0 deletions public/locales/es/demo.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"app_config_not_found": "Configuración de aplicación inválida o no encontrada",
"app_config_learn_more": "",
"cancel_config_id": "Cancelar",
"click_to_unselect_config": "(haz clic aquí para deseleccionar esta configuración)",
"currently_previewing_config": "Actualmente estás previsualizando la configuración: '{{configSource}}'",
Expand Down
11 changes: 10 additions & 1 deletion src/components/DemoConfigDialog/DemoConfigDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { ChangeEventHandler, MouseEventHandler, useEffect, useState } fro
import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router';
import type { UseQueryResult } from 'react-query';
import { Helmet } from 'react-helmet';

import styles from './DemoConfigDialog.module.scss';

Expand Down Expand Up @@ -136,16 +137,24 @@ const DemoConfigDialog = ({ selectedConfigSource, configQuery }: Props) => {

return (
<>
{!configQuery.isSuccess && (
<Helmet>
<meta name="description" content="Enter the App Config ID" />
</Helmet>
)}
{configQuery.isSuccess && (
<div className={styles.note}>
<div>{t('currently_previewing_config', { configSource: selectedConfigSource })}</div>
<Link onClick={clearConfig}>{t('click_to_unselect_config')}</Link>
<Link href="javascript:;" onClick={clearConfig}>
{t('click_to_unselect_config')}
</Link>
</div>
)}
{!configQuery.isSuccess && (
<div className={styles.configModal}>
<ErrorPage
title={t('app_config_not_found')}
learnMoreLabel={t('app_config_learn_more')}
helpLink={'https://docs.jwplayer.com/platform/docs/ott-create-an-app-config'}
error={typeof state.error === 'string' ? undefined : state.error}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ exports[`<DemoConfigDialog> > renders and matches snapshot 1`] = `
</div>
<a
class="_link_a14c64"
href="javascript:;"
>
click_to_unselect_config
</a>
Expand Down Expand Up @@ -104,7 +105,7 @@ exports[`<DemoConfigDialog> > renders and matches snapshot error dialog 1`] = `
rel="noreferrer"
target="_blank"
>
learn_more
app_config_learn_more
</a>
</p>
</main>
Expand Down
7 changes: 4 additions & 3 deletions src/containers/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const Layout = () => {
const { t, i18n } = useTranslation('common');
const { config, accessModel } = useConfigStore(({ config, accessModel }) => ({ config, accessModel }), shallow);
const { menu, assets, siteName, description, styling, features } = config;
const metaDescription = description || t('default_description');
const { clientId } = useClientIntegration();
const { searchPlaylist } = features || {};
const { footerText } = styling || {};
Expand Down Expand Up @@ -105,11 +106,11 @@ const Layout = () => {
<div className={styles.layout}>
<Helmet>
<title>{siteName}</title>
<meta name="description" content={description} />
<meta property="og:description" content={description} />
<meta name="description" content={metaDescription} />
<meta property="og:description" content={metaDescription} />
<meta property="og:title" content={siteName} />
<meta name="twitter:title" content={siteName} />
<meta name="twitter:description" content={description} />
<meta name="twitter:description" content={metaDescription} />
</Helmet>
<div className={styles.main}>
<Header
Expand Down

0 comments on commit 2274c9b

Please sign in to comment.