From 7a95ee25940a20bcf0c54ee58d9907db9c67d770 Mon Sep 17 00:00:00 2001 From: Michael Hsu Date: Mon, 12 Jun 2017 11:00:36 +0800 Subject: [PATCH 1/5] fix(addons/info): Cannot read property 'props' of undefined fix(addons/info): Cannot read property 'props' of undefined --- addons/info/src/components/markdown/text.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/info/src/components/markdown/text.js b/addons/info/src/components/markdown/text.js index f3385a4248ad..3b20c6608fc4 100644 --- a/addons/info/src/components/markdown/text.js +++ b/addons/info/src/components/markdown/text.js @@ -42,7 +42,7 @@ export function A(props) { const style = { color: '#3498db', }; - return {props.children}; + return {props.children}; } A.defaultProps = defaultProps; From a7ddf631696989d1f5e8693c15e460f957414db7 Mon Sep 17 00:00:00 2001 From: Michael Hsu Date: Mon, 12 Jun 2017 11:14:46 +0800 Subject: [PATCH 2/5] add propTypes --- addons/info/src/components/markdown/text.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/info/src/components/markdown/text.js b/addons/info/src/components/markdown/text.js index 3b20c6608fc4..f73a3ac901fc 100644 --- a/addons/info/src/components/markdown/text.js +++ b/addons/info/src/components/markdown/text.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import { baseFonts } from '../theme'; const defaultProps = { children: null }; -const propTypes = { children: PropTypes.node }; +const propTypes = { children: PropTypes.node, href: PropTypes.string }; export function P(props) { const style = { From 13939bdb464eeaaded0ea93c66bf783ce57db30a Mon Sep 17 00:00:00 2001 From: Michael Hsu Date: Mon, 12 Jun 2017 11:31:59 +0800 Subject: [PATCH 3/5] update propTypes --- addons/info/src/components/markdown/text.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/info/src/components/markdown/text.js b/addons/info/src/components/markdown/text.js index f73a3ac901fc..f305ba02ac65 100644 --- a/addons/info/src/components/markdown/text.js +++ b/addons/info/src/components/markdown/text.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import { baseFonts } from '../theme'; const defaultProps = { children: null }; -const propTypes = { children: PropTypes.node, href: PropTypes.string }; +const propTypes = { children: PropTypes.node }; export function P(props) { const style = { @@ -46,4 +46,4 @@ export function A(props) { } A.defaultProps = defaultProps; -A.propTypes = propTypes; +A.propTypes = { children: PropTypes.node, href: PropTypes.string }; From 71a48df16c42a8c863d3f6d8ca6e84fe50552dda Mon Sep 17 00:00:00 2001 From: Michael Hsu Date: Mon, 12 Jun 2017 11:41:47 +0800 Subject: [PATCH 4/5] isRequired --- addons/info/src/components/markdown/text.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/info/src/components/markdown/text.js b/addons/info/src/components/markdown/text.js index f305ba02ac65..6f24ee34e1a0 100644 --- a/addons/info/src/components/markdown/text.js +++ b/addons/info/src/components/markdown/text.js @@ -46,4 +46,4 @@ export function A(props) { } A.defaultProps = defaultProps; -A.propTypes = { children: PropTypes.node, href: PropTypes.string }; +A.propTypes = { children: PropTypes.node, href: PropTypes.string.isRequired }; From 106514f6f2dbcf30bddb7c4905839eedd09f9f06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Hsu=20=28=E5=BE=90=E6=89=BF=E5=BF=97=29?= Date: Mon, 12 Jun 2017 16:44:38 +0800 Subject: [PATCH 5/5] feat(Addon/info): use external links --- addons/info/src/components/markdown/text.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/info/src/components/markdown/text.js b/addons/info/src/components/markdown/text.js index 6f24ee34e1a0..dae5f8f3a93e 100644 --- a/addons/info/src/components/markdown/text.js +++ b/addons/info/src/components/markdown/text.js @@ -42,7 +42,11 @@ export function A(props) { const style = { color: '#3498db', }; - return {props.children}; + return ( + + {props.children} + + ); } A.defaultProps = defaultProps;