-
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
99604b9
commit 1fbd1d2
Showing
7 changed files
with
475 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { SiteBaseUrl } from 'constants/url' | ||
import { ProjectMetadata } from 'models/projectMetadata' | ||
import { cidFromUrl, ipfsPublicGatewayUrl } from 'utils/ipfs' | ||
import { stripHtmlTags } from 'utils/string' | ||
import { SEO } from './common/SEO/SEO' | ||
|
||
const ProjectPageSEO: React.FC<{ | ||
metadata?: ProjectMetadata | ||
url: string | ||
}> = ({ metadata, url }) => ( | ||
<SEO | ||
// Set known values, leave others undefined to be overridden | ||
title={metadata?.name} | ||
url={url} | ||
description={ | ||
metadata?.projectTagline | ||
? metadata.projectTagline | ||
: metadata?.description | ||
? stripHtmlTags(metadata.description) | ||
: undefined | ||
} | ||
twitter={{ | ||
card: 'summary', | ||
creator: metadata?.twitter, | ||
handle: metadata?.twitter, | ||
// Swap out all gateways with ipfs.io public gateway until we can resolve our meta tag issue. | ||
image: metadata?.logoUri | ||
? ipfsPublicGatewayUrl(cidFromUrl(metadata.logoUri)) | ||
: undefined, | ||
}} | ||
/> | ||
) | ||
|
||
export const V2V3ProjectSEO: React.FC<{ | ||
metadata?: ProjectMetadata | ||
projectId: number | ||
}> = ({ metadata, projectId }) => ( | ||
<ProjectPageSEO metadata={metadata} url={`${SiteBaseUrl}v2/p/${projectId}`} /> | ||
) | ||
|
||
export const V4ProjectSEO: React.FC<{ | ||
metadata?: ProjectMetadata | ||
chainName: string | ||
projectId: number | ||
}> = ({ metadata, chainName, projectId }) => { | ||
return ( | ||
<ProjectPageSEO | ||
metadata={metadata} | ||
url={`${SiteBaseUrl}v4/${chainName}/p/${projectId}`} | ||
/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.