Skip to content

Commit

Permalink
chore: [UPM-777]/evgeniy/link hreflang and canonical tags seo (deriv-…
Browse files Browse the repository at this point in the history
  • Loading branch information
yauheni-deriv authored Apr 24, 2024
1 parent a08a415 commit 8382cee
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 99 deletions.
13 changes: 1 addition & 12 deletions packages/account/src/Components/Routes/route-with-sub-routes.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
import React from 'react';
import { RouteComponentProps } from 'react-router';
import { Redirect, Route } from 'react-router-dom';
import {
alternateLinkTagChange,
canonicalLinkTagChange,
redirectToLogin,
isEmptyObject,
routes,
removeBranchName,
default_title,
} from '@deriv/shared';
import { redirectToLogin, isEmptyObject, routes, removeBranchName, default_title } from '@deriv/shared';
import { getLanguage } from '@deriv/translations';
import { TBinaryRoutes, TRoute, TRouteConfig } from '../../Types';

Expand Down Expand Up @@ -54,9 +46,6 @@ const RouteWithSubRoutes = (route: TRouteWithSubRoutesProps) => {
const title = route.getTitle?.() ?? '';
document.title = `${title} | ${default_title}`;

alternateLinkTagChange();
canonicalLinkTagChange();

return result;
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
import { AutoHeightWrapper } from '@deriv/components';
import ProofOfIdentityContainer from './proof-of-identity-container.jsx';
import React from 'react';
import { changeMetaTagWithOG } from '@deriv/shared';
import { withRouter } from 'react-router-dom';
import { AutoHeightWrapper } from '@deriv/components';
import ProofOfIdentityContainer from './proof-of-identity-container.jsx';

const ProofOfIdentity = ({ is_from_external, onStateChange }) => {
// next useEffect implements seo requirements
React.useEffect(() => {
const description_content = 'Submit your proof of identity documents to verify your account and start trading';
const title_content = 'Account Verification | Deriv app';

const restoreMetaTagWithOGDescription = changeMetaTagWithOG('description', description_content);
const restoreMetaTagWithOGTitle = changeMetaTagWithOG('title', title_content);

return () => {
restoreMetaTagWithOGDescription();
restoreMetaTagWithOGTitle();
};
}, []);

return (
<AutoHeightWrapper default_height={200}>
{({ setRef, height }) => (
Expand Down
12 changes: 1 addition & 11 deletions packages/cashier/src/containers/routes/route-with-sub-routes.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import React from 'react';
import { RouteComponentProps } from 'react-router';
import { Redirect, Route } from 'react-router-dom';
import {
alternateLinkTagChange,
canonicalLinkTagChange,
redirectToLogin,
routes,
removeBranchName,
default_title,
} from '@deriv/shared';
import { redirectToLogin, routes, removeBranchName, default_title } from '@deriv/shared';
import { getLanguage } from '@deriv/translations';
import { TRootStore, TRouteConfig, TRoute } from '../../types';

Expand Down Expand Up @@ -47,9 +40,6 @@ const RouteWithSubRoutes = (route: TRouteWithSubRoutesProps) => {
const title = route.getTitle?.() || '';
document.title = `${title} | ${default_title}`;

alternateLinkTagChange();
canonicalLinkTagChange();

return result;
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';
import { Redirect, RedirectProps, Route, RouteComponentProps, RouteProps } from 'react-router-dom';
import {
alternateLinkTagChange,
canonicalLinkTagChange,
redirectToLogin,
removeBranchName,
routes as shared_routes,
Expand Down Expand Up @@ -93,9 +91,6 @@ const RouteWithSubRoutes = ({
const title = getTitle?.() || '';
document.title = `${title} | ${default_title}`;

alternateLinkTagChange();
canonicalLinkTagChange();

return result;
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
import React from 'react';
import { Redirect, Route } from 'react-router-dom';
import {
alternateLinkTagChange,
canonicalLinkTagChange,
redirectToLogin,
removeBranchName,
routes,
isEmptyObject,
default_title,
} from '@deriv/shared';
import { redirectToLogin, removeBranchName, routes, isEmptyObject, default_title } from '@deriv/shared';
import { getLanguage } from '@deriv/translations';
import Page404 from 'Modules/Page404';
import { observer, useStore } from '@deriv/stores';
Expand Down Expand Up @@ -88,9 +80,6 @@ const RouteWithSubRoutes = observer(route => {
const title = route.getTitle?.() || '';
document.title = `${title} | ${default_title}`;

alternateLinkTagChange();
canonicalLinkTagChange();

return result;
};

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
<link rel="preconnect" href="https://www.googletagmanager.com" />
<link rel="preconnect" href="https://browser-update.org" />

<link rel="alternate" hreflang="en-EN" href="https://app.deriv.com" />
<link rel="alternate" hreflang="en" href="https://app.deriv.com" />
<link rel="canonical" href="https://app.deriv.com" />

<title>Deriv App | Deriv</title>
Expand Down
1 change: 0 additions & 1 deletion packages/shared/src/utils/dom/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './position';
export * from './seo_optimization';
28 changes: 0 additions & 28 deletions packages/shared/src/utils/dom/seo_optimization.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
import React from 'react';
import { Redirect, Route, RouteComponentProps } from 'react-router-dom';
import {
alternateLinkTagChange,
canonicalLinkTagChange,
redirectToLogin,
removeBranchName,
routes,
isEmptyObject,
default_title,
} from '@deriv/shared';
import { redirectToLogin, removeBranchName, routes, isEmptyObject, default_title } from '@deriv/shared';
import { getLanguage } from '@deriv/translations';
import Page404 from 'Modules/Page404';
import { TBinaryRoutesProps, TRouteConfig } from 'Types';
Expand Down Expand Up @@ -57,9 +49,6 @@ const RouteWithSubRoutes = (route: TRouteWithSubRoutesProps) => {
const title = route.getTitle?.() ?? '';
document.title = `${title} | ${default_title}`;

alternateLinkTagChange();
canonicalLinkTagChange();

return result;
};

Expand Down

0 comments on commit 8382cee

Please sign in to comment.