Browse Source

Move types to separate declaration; related to #24

main
tricinel 8 years ago
parent
commit
9daf248d21
  1. 24
      src/components/MarkdownPage/MarkdownPage.js
  2. 11
      src/components/TitleAndMetaTags/TitleAndMetaTags.js
  3. 9
      src/templates/components/ChevronSvg/index.js

24
src/components/MarkdownPage/MarkdownPage.js

@ -19,6 +19,18 @@ import toCommaSeparatedList from 'utils/toCommaSeparatedList';
import {sharedStyles} from 'theme'; import {sharedStyles} from 'theme';
import createOgUrl from 'utils/createOgUrl'; import createOgUrl from 'utils/createOgUrl';
type Props = {
authors: Array<string>,
createLink: Function,
date?: string,
enableScrollSync?: boolean,
ogDescription: string,
location: Object,
markdownRemark: Object,
sectionList: Array<Object>,
titlePostfix: string,
};
const MarkdownPage = ({ const MarkdownPage = ({
authors = [], authors = [],
createLink, createLink,
@ -29,17 +41,7 @@ const MarkdownPage = ({
markdownRemark, markdownRemark,
sectionList, sectionList,
titlePostfix = '', titlePostfix = '',
}: { }: Props) => {
authors: Array<string>,
createLink: Function,
date: string,
enableScrollSync: boolean,
ogDescription: string,
location: Object,
markdownRemark: Object,
sectionList: Array<Object>,
titlePostfix: string,
}) => {
const hasAuthors = authors.length > 0; const hasAuthors = authors.length > 0;
const titlePrefix = markdownRemark.frontmatter.title || ''; const titlePrefix = markdownRemark.frontmatter.title || '';

11
src/components/TitleAndMetaTags/TitleAndMetaTags.js

@ -2,6 +2,7 @@
* Copyright (c) 2013-present, Facebook, Inc. * Copyright (c) 2013-present, Facebook, Inc.
* *
* @emails react-core * @emails react-core
* @flow
*/ */
'use strict'; 'use strict';
@ -11,15 +12,13 @@ import React from 'react';
const defaultDescription = 'A JavaScript library for building user interfaces'; const defaultDescription = 'A JavaScript library for building user interfaces';
const TitleAndMetaTags = ({ type Props = {
title,
ogDescription,
ogUrl,
}: {
title: string, title: string,
ogDescription: string, ogDescription: string,
ogUrl: string, ogUrl: string,
}) => { };
const TitleAndMetaTags = ({title, ogDescription, ogUrl}: Props) => {
return ( return (
<Helmet title={title}> <Helmet title={title}>
<meta property="og:title" content={title} /> <meta property="og:title" content={title} />

9
src/templates/components/ChevronSvg/index.js

@ -9,13 +9,12 @@
import React from 'react'; import React from 'react';
const ChevronSvg = ({ type Props = {
size = 10,
cssProps = {},
}: {
size: number, size: number,
cssProps: Object, cssProps: Object,
}) => ( };
const ChevronSvg = ({size = 10, cssProps = {}}: Props) => (
<svg <svg
css={cssProps} css={cssProps}
viewBox="0 0 926.23699 573.74994" viewBox="0 0 926.23699 573.74994"

Loading…
Cancel
Save