Skip to content

Commit

Permalink
✨ feat: 添加痛点 section
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Apr 10, 2021
1 parent 56b5355 commit 705e67f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
7 changes: 5 additions & 2 deletions docs/components/biz/examples/JourneyMap/yml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -25,7 +27,8 @@ stages:
emotion: -2
thoughts:
- 对比来对比去好麻烦
-
painPoints:
- 能否有一个一键对比的能力
- name: 确定平台
emotion: 0
Expand Down
10 changes: 10 additions & 0 deletions packages/journey-map/src/PainPoints/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { FC } from 'react';
import React from 'react';

import { ListSection } from '../components';

const PainPoints: FC = () => {
return <ListSection title={'痛点'} sectionKey={'painPoints'} />;
};

export default PainPoints;
6 changes: 4 additions & 2 deletions packages/journey-map/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -54,8 +56,8 @@ const JourneyMap: FC<JourneyMapProps> = ({
stage: Stage,
emotion: Chart,
thought: Thoughts,
painPoint: PainPoints,
chance: () => <div />,
painSpot: () => <div />,
};

const arrange = store.config?.arrange || [
Expand Down
2 changes: 1 addition & 1 deletion packages/journey-map/src/types/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export type SectionType =
| 'action'
| 'emotion'
| 'thought'
| 'painSpot'
| 'painPoint'
| 'chance';

/**
Expand Down

0 comments on commit 705e67f

Please sign in to comment.