From 705e67f7e0f287cd370d8b23e87117d778eb7b5f Mon Sep 17 00:00:00 2001 From: arvinxx Date: Sat, 10 Apr 2021 11:10:11 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20feat:=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=97=9B=E7=82=B9=20section?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/components/biz/examples/JourneyMap/yml.ts | 7 +++++-- packages/journey-map/src/PainPoints/index.tsx | 10 ++++++++++ packages/journey-map/src/index.tsx | 6 ++++-- packages/journey-map/src/types/type.ts | 2 +- 4 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 packages/journey-map/src/PainPoints/index.tsx diff --git a/docs/components/biz/examples/JourneyMap/yml.ts b/docs/components/biz/examples/JourneyMap/yml.ts index ec7bc410..4afedbd8 100644 --- a/docs/components/biz/examples/JourneyMap/yml.ts +++ b/docs/components/biz/examples/JourneyMap/yml.ts @@ -3,12 +3,14 @@ export const data = ` title: YML 字符串租车地图 config: - # 支持使用 stage + # 目前支持 stage、emotion、action、thought painPoint 五层 + # 可自行排序(上下切换 section 的位置即可) arrange: - stage - action - emotion - thought + - painPoint height: emotion: 150 @@ -25,7 +27,8 @@ stages: emotion: -2 thoughts: - 对比来对比去好麻烦 - - + painPoints: + - 能否有一个一键对比的能力 - name: 确定平台 emotion: 0 diff --git a/packages/journey-map/src/PainPoints/index.tsx b/packages/journey-map/src/PainPoints/index.tsx new file mode 100644 index 00000000..ca6ca9df --- /dev/null +++ b/packages/journey-map/src/PainPoints/index.tsx @@ -0,0 +1,10 @@ +import type { FC } from 'react'; +import React from 'react'; + +import { ListSection } from '../components'; + +const PainPoints: FC = () => { + return ; +}; + +export default PainPoints; diff --git a/packages/journey-map/src/index.tsx b/packages/journey-map/src/index.tsx index 6e3501aa..77f89c15 100644 --- a/packages/journey-map/src/index.tsx +++ b/packages/journey-map/src/index.tsx @@ -3,11 +3,13 @@ import type { FC, CSSProperties } from 'react'; import cls from 'classnames'; import { ErrorBoundary } from 'react-error-boundary'; +import { ErrorFallback } from './components'; + import Stage from './Stages'; import Chart from './Chart'; import Actions from './Actions'; import Thoughts from './Thoughts'; -import { ErrorFallback } from './components'; +import PainPoints from './PainPoints'; import { JourneyMapStore, useJourneyMap } from './useJourneyMap'; import type { Config, JourneyMapData, SectionType } from './types'; @@ -54,8 +56,8 @@ const JourneyMap: FC = ({ stage: Stage, emotion: Chart, thought: Thoughts, + painPoint: PainPoints, chance: () =>
, - painSpot: () =>
, }; const arrange = store.config?.arrange || [ diff --git a/packages/journey-map/src/types/type.ts b/packages/journey-map/src/types/type.ts index 30282825..fc72980f 100644 --- a/packages/journey-map/src/types/type.ts +++ b/packages/journey-map/src/types/type.ts @@ -72,7 +72,7 @@ export type SectionType = | 'action' | 'emotion' | 'thought' - | 'painSpot' + | 'painPoint' | 'chance'; /**