From 84aa832da4d26c55e7920e3e3ad740437f124eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Benitte?= Date: Mon, 27 Aug 2018 18:28:48 +0900 Subject: [PATCH] feat(components): fix components display name --- .storybook/config.js | 20 -------------------- packages/circle-packing/src/Bubble.js | 5 ++++- packages/circle-packing/src/BubbleCanvas.js | 5 ++++- packages/circle-packing/src/BubbleHtml.js | 5 ++++- packages/line/src/Line.js | 2 +- packages/line/stories/line.stories.js | 2 +- packages/radar/src/Radar.js | 2 +- packages/sankey/src/Sankey.js | 5 ++++- packages/sankey/stories/sankey.stories.js | 2 +- packages/scales/package.json | 3 +++ packages/stream/src/Stream.js | 2 +- packages/sunburst/src/Sunburst.js | 2 +- packages/treemap/src/TreeMap.js | 5 ++++- packages/treemap/src/TreeMapCanvas.js | 7 +++++-- packages/treemap/src/TreeMapHtml.js | 5 ++++- 15 files changed, 38 insertions(+), 34 deletions(-) diff --git a/.storybook/config.js b/.storybook/config.js index 53d021cd1..07acd4d61 100644 --- a/.storybook/config.js +++ b/.storybook/config.js @@ -33,26 +33,6 @@ setDefaults({ fontSize: '22px', }, }, - /* - header: { - h1: { - margin: 0, - padding: 0, - fontSize: '35px', - }, - h2: { - margin: '0 0 10px 0', - padding: 0, - fontWeight: 400, - fontSize: '22px', - }, - body: { - borderBottom: '1px solid #eee', - paddingTop: 10, - marginBottom: 10, - }, - }, - */ }, }) setAddon(infoAddon) diff --git a/packages/circle-packing/src/Bubble.js b/packages/circle-packing/src/Bubble.js index 2e6013ffa..de736cd8f 100644 --- a/packages/circle-packing/src/Bubble.js +++ b/packages/circle-packing/src/Bubble.js @@ -134,4 +134,7 @@ const Bubble = ({ Bubble.displayName = 'Bubble' -export default enhance(Bubble) +const enhancedBubble = enhance(Bubble) +enhancedBubble.displayName = 'Bubble' + +export default enhancedBubble diff --git a/packages/circle-packing/src/BubbleCanvas.js b/packages/circle-packing/src/BubbleCanvas.js index 97e50880f..6bf8cbb88 100644 --- a/packages/circle-packing/src/BubbleCanvas.js +++ b/packages/circle-packing/src/BubbleCanvas.js @@ -127,4 +127,7 @@ class BubbleCanvas extends Component { BubbleCanvas.displayName = 'BubbleCanvas' -export default enhance(BubbleCanvas) +const enhancedBubbleCanvas = enhance(BubbleCanvas) +enhancedBubbleCanvas.displayName = 'BubbleCanvas' + +export default enhancedBubbleCanvas diff --git a/packages/circle-packing/src/BubbleHtml.js b/packages/circle-packing/src/BubbleHtml.js index 62563d0b1..32e7d6ec4 100644 --- a/packages/circle-packing/src/BubbleHtml.js +++ b/packages/circle-packing/src/BubbleHtml.js @@ -143,4 +143,7 @@ const BubbleHtml = ({ BubbleHtml.displayName = 'BubbleHtml' -export default enhance(BubbleHtml) +const enhancedBubbleHtml = enhance(BubbleHtml) +enhancedBubbleHtml.displayName = 'BubbleHtml' + +export default enhancedBubbleHtml diff --git a/packages/line/src/Line.js b/packages/line/src/Line.js index dcff874ee..e2a870d5d 100644 --- a/packages/line/src/Line.js +++ b/packages/line/src/Line.js @@ -273,6 +273,6 @@ const enhance = compose( ) const enhancedLine = enhance(Line) -enhancedLine.displayName = 'enhance(Line)' +enhancedLine.displayName = 'Line' export default enhancedLine diff --git a/packages/line/stories/line.stories.js b/packages/line/stories/line.stories.js index 7e24c6955..d9900458a 100644 --- a/packages/line/stories/line.stories.js +++ b/packages/line/stories/line.stories.js @@ -327,7 +327,7 @@ stories.add( withInfo(` Please note that when using stacked y scale with variable length/data holes, if one of the y value is \`null\` all subsequent values will be skipped - as we cannot compute the sum. + as we cannot properly compute the sum. `)(() => ( d.id @@ -217,5 +218,7 @@ const Sankey = ({ } Sankey.propTypes = SankeyPropTypes +const enhancedSankey = enhance(Sankey) +enhancedSankey.displayName = 'Sankey' -export default enhance(Sankey) +export default enhancedSankey diff --git a/packages/sankey/stories/sankey.stories.js b/packages/sankey/stories/sankey.stories.js index 00d439357..b626411b0 100644 --- a/packages/sankey/stories/sankey.stories.js +++ b/packages/sankey/stories/sankey.stories.js @@ -6,7 +6,7 @@ import { Sankey } from '../index' const commonProperties = { width: 900, - height: 500, + height: 400, margin: { top: 0, right: 80, bottom: 0, left: 80 }, data: generateSankeyData({ nodeCount: 11, maxIterations: 2 }), colors: 'd310', diff --git a/packages/scales/package.json b/packages/scales/package.json index 9a8de0a12..80292ac38 100644 --- a/packages/scales/package.json +++ b/packages/scales/package.json @@ -13,6 +13,9 @@ "d3-scale": "^2.1.2", "lodash": "^4.17.4" }, + "peerDependencies": { + "prop-types": "^15.5.10" + }, "publishConfig": { "access": "public" } diff --git a/packages/stream/src/Stream.js b/packages/stream/src/Stream.js index cacf9c2ed..f99dc96e4 100644 --- a/packages/stream/src/Stream.js +++ b/packages/stream/src/Stream.js @@ -181,6 +181,6 @@ const Stream = ({ Stream.propTypes = StreamPropTypes const enhancedStream = enhance(Stream) -enhancedStream.displayName = 'enhance(Stream)' +enhancedStream.displayName = 'Stream' export default enhancedStream diff --git a/packages/sunburst/src/Sunburst.js b/packages/sunburst/src/Sunburst.js index 6b370cb6b..02a38ac90 100644 --- a/packages/sunburst/src/Sunburst.js +++ b/packages/sunburst/src/Sunburst.js @@ -189,6 +189,6 @@ const enhance = compose( ) const enhancedSunburst = enhance(Sunburst) -enhancedSunburst.displayName = 'enhance(Sunburst)' +enhancedSunburst.displayName = 'Sunburst' export default enhancedSunburst diff --git a/packages/treemap/src/TreeMap.js b/packages/treemap/src/TreeMap.js index e29cc7c4e..9ea09ebfa 100644 --- a/packages/treemap/src/TreeMap.js +++ b/packages/treemap/src/TreeMap.js @@ -136,4 +136,7 @@ const TreeMap = ({ TreeMap.propTypes = TreeMapPropTypes TreeMap.displayName = 'TreeMap' -export default enhance(TreeMap) +const enhancedTreeMap = enhance(TreeMap) +enhancedTreeMap.displayName = 'TreeMap' + +export default enhancedTreeMap diff --git a/packages/treemap/src/TreeMapCanvas.js b/packages/treemap/src/TreeMapCanvas.js index adec500c4..218741f7d 100644 --- a/packages/treemap/src/TreeMapCanvas.js +++ b/packages/treemap/src/TreeMapCanvas.js @@ -10,7 +10,7 @@ import React, { Component } from 'react' import { degreesToRadians } from '@nivo/core' import { getRelativeCursor, isCursorInRect } from '@nivo/core' import { Container } from '@nivo/core' -import { TreeMapCanvasPropTypes } from './props' +import { TreeMapCanvasPropTypes, TreeMapHtmlPropTypes } from './props' import enhance from './enhance' import TreeMapNodeTooltip from './TreeMapNodeTooltip' @@ -152,4 +152,7 @@ class TreeMapCanvas extends Component { TreeMapCanvas.propTypes = TreeMapCanvasPropTypes TreeMapCanvas.displayName = 'TreeMapCanvas' -export default enhance(TreeMapCanvas) +const enhancedTreeMapCanvas = enhance(TreeMapCanvas) +enhancedTreeMapCanvas.displayName = 'TreeMapCanvas' + +export default enhancedTreeMapCanvas diff --git a/packages/treemap/src/TreeMapHtml.js b/packages/treemap/src/TreeMapHtml.js index c8d872d13..cf9bac35c 100644 --- a/packages/treemap/src/TreeMapHtml.js +++ b/packages/treemap/src/TreeMapHtml.js @@ -146,4 +146,7 @@ const TreeMapHtml = ({ TreeMapHtml.propTypes = TreeMapHtmlPropTypes TreeMapHtml.displayName = 'TreeMapHtml' -export default enhance(TreeMapHtml) +const enhancedTreeMapHtml = enhance(TreeMapHtml) +enhancedTreeMapHtml.displayName = 'TreeMapHtml' + +export default enhancedTreeMapHtml