diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-07-27 17:59:35 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-07-30 15:48:39 +0800 |
commit | 5283dcce2ea5878ac45b9b297c0882f926feb344 (patch) | |
tree | 719cfb9417d2508822d346c288ef69567d6178f1 /packages/website/ts/components | |
parent | 48e538f5c7dc208775ec71635e4d4866b5907228 (diff) | |
download | dexon-sol-tools-5283dcce2ea5878ac45b9b297c0882f926feb344.tar dexon-sol-tools-5283dcce2ea5878ac45b9b297c0882f926feb344.tar.gz dexon-sol-tools-5283dcce2ea5878ac45b9b297c0882f926feb344.tar.bz2 dexon-sol-tools-5283dcce2ea5878ac45b9b297c0882f926feb344.tar.lz dexon-sol-tools-5283dcce2ea5878ac45b9b297c0882f926feb344.tar.xz dexon-sol-tools-5283dcce2ea5878ac45b9b297c0882f926feb344.tar.zst dexon-sol-tools-5283dcce2ea5878ac45b9b297c0882f926feb344.zip |
Create MetaTags component
Diffstat (limited to 'packages/website/ts/components')
-rw-r--r-- | packages/website/ts/components/meta_tags.tsx | 25 | ||||
-rw-r--r-- | packages/website/ts/components/portal/portal.tsx | 6 |
2 files changed, 30 insertions, 1 deletions
diff --git a/packages/website/ts/components/meta_tags.tsx b/packages/website/ts/components/meta_tags.tsx new file mode 100644 index 000000000..f6c43d23f --- /dev/null +++ b/packages/website/ts/components/meta_tags.tsx @@ -0,0 +1,25 @@ +import * as React from 'react'; +import { Helmet } from 'react-helmet'; + +export interface MetaTagsProps { + title: string; + description: string; + imgSrc?: string; +} + +export const MetaTags: React.StatelessComponent<MetaTagsProps> = ({ title, description, imgSrc }) => ( + <Helmet> + <title>{title}</title> + <meta name="description" content={description} /> + <meta property="og:title" content={title} /> + <meta property="og:description" content={description} /> + <meta property="og:type" content="website" /> + <meta property="og:image" content={imgSrc} /> + <meta name="twitter:site" content="@0xproject" /> + <meta name="twitter:image" content={imgSrc} /> + </Helmet> +); + +MetaTags.defaultProps = { + imgSrc: '/images/og_image.png', +}; diff --git a/packages/website/ts/components/portal/portal.tsx b/packages/website/ts/components/portal/portal.tsx index c61d04906..ff11880e3 100644 --- a/packages/website/ts/components/portal/portal.tsx +++ b/packages/website/ts/components/portal/portal.tsx @@ -12,6 +12,7 @@ import { PortalDisclaimerDialog } from 'ts/components/dialogs/portal_disclaimer_ import { EthWrappers } from 'ts/components/eth_wrappers'; import { FillOrder } from 'ts/components/fill_order'; import { AssetPicker } from 'ts/components/generate_order/asset_picker'; +import { MetaTags } from 'ts/components/meta_tags'; import { BackButton } from 'ts/components/portal/back_button'; import { Loading } from 'ts/components/portal/loading'; import { Menu, MenuTheme } from 'ts/components/portal/menu'; @@ -108,6 +109,8 @@ const LEFT_COLUMN_WIDTH = 346; const MENU_PADDING_LEFT = 185; const LARGE_LAYOUT_MAX_WIDTH = 1200; const SIDE_PADDING = 20; +const DOCUMENT_TITLE = '0x Portal'; +const DOCUMENT_DESCRIPTION = 'Learn about and trade on 0x Relayers'; export class Portal extends React.Component<PortalProps, PortalState> { private _blockchain: Blockchain; @@ -226,7 +229,8 @@ export class Portal extends React.Component<PortalProps, PortalState> { : TokenVisibility.TRACKED; return ( <Container> - <DocumentTitle title="0x Portal" /> + <MetaTags title={DOCUMENT_TITLE} description={DOCUMENT_DESCRIPTION} /> + <DocumentTitle title={DOCUMENT_TITLE} /> <TopBar userAddress={this.props.userAddress} networkId={this.props.networkId} |