Skip to content

Commit

Permalink
Add meta tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Joozty committed Nov 16, 2020
1 parent df7ea7a commit 79974a8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 17 deletions.
49 changes: 33 additions & 16 deletions pages/data-providers/[data-provider-id].jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import React, { useEffect, useRef } from 'react'
import { useRouter } from 'next/router'
import Head from 'next/head'

import { generateMetadata } from '../../templates/data-providers/utils'

import { useSyncUrlParamsWithStore } from 'hooks/use-sync-url-params-with-store'
import { convertAndValidate } from 'utils/validation'
Expand Down Expand Up @@ -96,22 +99,36 @@ const DataProviderPage = observe(({ initialState }) => {
])

return (
<DataProviderTemplate
outputs={dataProvider.outputs}
loadPage={dataProvider.loadPage}
metadata={dataProvider.metadata}
query={dataProvider.params.q}
setQuery={(q) => {
dataProvider.params.q = q
}}
from={dataProvider.params.from}
size={dataProvider.params.size}
// TODO: Get proper value from API
total={50000}
loading={dataProvider.loading}
basePath={`/data-providers/${dataProvider.id}`}
isLoadingMore={dataProvider.isLoadingMore}
/>
<>
<Head>
<title>
{dataProvider.params.q
? `Search "${dataProvider.params.q}" in ${dataProvider.metadata.name}`
: `${dataProvider.metadata.name}`}
Data providers search
</title>
<meta
name="description"
content={`Search over TODO works in ${dataProvider.metadata.name}.`}
/>
</Head>
<DataProviderTemplate
outputs={dataProvider.outputs}
loadPage={dataProvider.loadPage}
metadata={dataProvider.metadata}
query={dataProvider.params.q}
setQuery={(q) => {
dataProvider.params.q = q
}}
from={dataProvider.params.from}
size={dataProvider.params.size}
// TODO: Get proper value from API
total={50000}
loading={dataProvider.loading}
basePath={`/data-providers/${dataProvider.id}`}
isLoadingMore={dataProvider.isLoadingMore}
/>
</>
)
})

Expand Down
2 changes: 1 addition & 1 deletion pages/data-providers/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const SearchPage = observe(({ initialState }) => {
<title>{query ? `${query} - ` : ''}Data providers search</title>
<meta
name="description"
content={`Search over ${data.length} repositories and journals around the world`}
content={`Search over ${data.length} repositories and journals around the world.`}
/>
{/* eslint-disable react/no-danger */}
<script
Expand Down

0 comments on commit 79974a8

Please sign in to comment.