Skip to content

Commit

Permalink
Merge pull request #135 from valory-xyz/precious/duplicate-title-tags
Browse files Browse the repository at this point in the history
chore: added title to Veolas for duplicate title error in SEMrush
  • Loading branch information
atepem authored Nov 14, 2024
2 parents 0d2f5d9 + 87a4e44 commit 0e0e373
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 6 deletions.
63 changes: 63 additions & 0 deletions apps/govern/components/Meta.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import React from 'react';
import PropTypes from 'prop-types';
import Head from 'next/head';

const SITE_URL = 'https://govern.olas.network';
const SITE_TITLE = 'Olas Govern';
const SITE_DESCRIPTION =
'View various contracts and join the decision-making process that drives growth in the Olas ecosystem; direct the future of Olas.';

const Meta = ({
pageTitle,
description,
pageUrl,
}: {
pageTitle: string;
description: string;
pageUrl: string;
}) => {
const title = pageTitle ? `${pageTitle} | ${SITE_TITLE}` : SITE_TITLE;
const url = `${SITE_URL}/${pageUrl}`;

return (
<Head>
{/* <!-- Primary Meta Tags --> */}
<title>{title}</title>
<meta name="title" content={title} key="title" />
<meta name="description" content={description || SITE_DESCRIPTION} key="description" />

{/* <!-- Open Graph / Facebook --> */}
<meta property="og:type" content="website" key="og:type" />
<meta property="og:url" content={url} key="og:url" />
<meta property="og:title" content={title} key="og:title" />
<meta
property="og:description"
content={description || SITE_DESCRIPTION}
key="og:description"
/>

{/* <!-- Twitter --> */}
<meta property="twitter:card" content="summary_large_image" key="twitter:card" />
<meta property="twitter:url" content={url} key="twitter:url" />
<meta property="twitter:title" content={title} key="twitter:title" />
<meta
property="twitter:description"
content={description || SITE_DESCRIPTION}
key="twitter:description"
/>
</Head>
);
};

Meta.propTypes = {
pageTitle: PropTypes.string,
description: PropTypes.string,
pageUrl: PropTypes.string,
};
Meta.defaultProps = {
pageTitle: null,
description: SITE_DESCRIPTION,
pageUrl: '',
};

export default Meta;
2 changes: 1 addition & 1 deletion apps/govern/components/VeOlas/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const Title = styled.h1`
margin: 0 0 8px;
`;

export const VeOlasPage = () => {
export const VeOlas = () => {
const { isLoading, canWithdrawVeolas, canIncreaseAmountOrUnlock } = useFetchBalances();

const [isCreateLockModalVisible, setIsCreateLockModalVisible] = useState(false);
Expand Down
6 changes: 2 additions & 4 deletions apps/govern/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { AppProps } from 'next/app';
import Head from 'next/head';
import { FC, PropsWithChildren } from 'react';
import { Provider } from 'react-redux';

Expand All @@ -11,6 +10,7 @@ import { Web3ModalProvider } from 'context/Web3ModalProvider';
import { Layout } from '../components/Layout';
import { useFetchStakingContractsList, useFetchUserVotes } from '../hooks';
import { wrapper } from '../store';
import Meta from 'components/Meta';

const DataProvider: FC<PropsWithChildren> = ({ children }) => {
useFetchStakingContractsList();
Expand All @@ -25,9 +25,7 @@ const GovernApp = ({ Component, ...rest }: AppProps) => {
return (
<>
<GlobalStyles />
<Head>
<title>Govern</title>
</Head>
<Meta />

<Provider store={store}>
<AutonolasThemeProvider>
Expand Down
14 changes: 13 additions & 1 deletion apps/govern/pages/veolas.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
import { VeOlasPage } from '../components/VeOlas';
import Meta from 'components/Meta';
import { VeOlas } from '../components/VeOlas';

const VeOlasPage = () => (
<>
<Meta
pageTitle="veOLAS"
description="Easily check, manage, and optimize your veOLAS balance to actively participate in decisions shaping the future of the Olas network."
pageUrl="veOlas"
/>
<VeOlas />
</>
);

export default VeOlasPage;

0 comments on commit 0e0e373

Please sign in to comment.