Skip to content

Commit

Permalink
fix: fix pizza seo title and description
Browse files Browse the repository at this point in the history
  • Loading branch information
allohamora committed Mar 18, 2022
1 parent f60a3d3 commit 9f9eaaa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/views/Pizza/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ export const Pizza: FC = () => {
const titleKey = `${lang as Lang}_title` as const;
const title = data?.[titleKey];

const titleText = createTitleText(title as string, data?.size ?? null, tValue('cm'));

const descriptionKey = `${lang as Lang}_description` as const;
const description = data?.[descriptionKey];

const seo = <Seo title={title ?? t('loading')} description={description ?? t('loading')} />;
const seo = <Seo title={titleText ?? t('loading')} description={description ?? t('loading')} />;

if (isLoading) {
return (
Expand All @@ -68,7 +70,7 @@ export const Pizza: FC = () => {
);
}

const { country, city, lang: pizzaLang, image, link, price, size, weight, historyOfChanges } = data as PizzaType;
const { country, city, lang: pizzaLang, image, link, price, weight, historyOfChanges } = data as PizzaType;

const getChangeTitle = (key: string) => {
if (key === titleKey) {
Expand Down Expand Up @@ -98,7 +100,6 @@ export const Pizza: FC = () => {
detectedAt: change.detectedAt,
})) ?? [];

const titleText = createTitleText(title as string, size, tValue('cm'));
const weightText = createWeightText(weight, tValue('gram'));
const pirceText = createPriceText(price, tValue('uah'));

Expand Down

0 comments on commit 9f9eaaa

Please sign in to comment.