Meta titles and desc
This commit is contained in:
12
frontend/pages/vendors/[slug]/index.js
vendored
12
frontend/pages/vendors/[slug]/index.js
vendored
@@ -1,8 +1,9 @@
|
||||
import { Link } from '@chakra-ui/next-js'
|
||||
import { Box, Button, Flex, Heading, Image, List, ListIcon, ListItem, SimpleGrid, Text } from '@chakra-ui/react'
|
||||
import { iso31661 } from 'iso-3166'
|
||||
import Head from 'next/head'
|
||||
import { FaFacebookSquare, FaLinkedin, FaTwitterSquare } from 'react-icons/fa'
|
||||
import { TbWorldWww } from 'react-icons/tb'
|
||||
import { iso31661 } from 'iso-3166'
|
||||
|
||||
export const getStaticPaths = async () => {
|
||||
const url = new URL(`${process.env.NEXT_PUBLIC_DIRECTUS_API_URL}/items/vendors`)
|
||||
@@ -35,12 +36,17 @@ export const getStaticProps = async ({ params: { slug } }) => {
|
||||
data: [vendor],
|
||||
} = await res.json()
|
||||
|
||||
return { props: { ...vendor, country: iso31661.find((iso) => iso.alpha3 === vendor.country)?.name || '' } }
|
||||
return {
|
||||
props: { vendor: { ...vendor, country: iso31661.find((iso) => iso.alpha3 === vendor.country)?.name || '' } },
|
||||
}
|
||||
}
|
||||
|
||||
export default function VendorPage(vendor) {
|
||||
export default function VendorPage({ globals, vendor }) {
|
||||
return (
|
||||
<Box className="vendor">
|
||||
<Head>
|
||||
<title>{[vendor.name, globals.meta_title].join(' — ')}</title>
|
||||
</Head>
|
||||
<Flex justifyContent="space-between" direction={['column', 'column', 'row']}>
|
||||
<Heading marginY="6">{vendor.name}</Heading>
|
||||
<Image
|
||||
|
||||
Reference in New Issue
Block a user