Skip to content

Commit

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

import { useSyncUrlParamsWithStore } from 'hooks/use-sync-url-params-with-store'
import { convertAndValidate } from 'utils/validation'
Expand Down Expand Up @@ -96,22 +97,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 2ea3207

Please sign in to comment.