Skip to content

Commit 81f1a28

Browse files
committed
Show total number of steps in tutorial
1 parent 4ee28d5 commit 81f1a28

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/components/Tutorial.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import React, { Component, PropTypes } from 'react'
22
import JoyRide from 'react-joyride'
33

44
import { getMessage } from '../utils/translationUtils'
5-
import { getTutorialConfig } from './tutorialSteps'
5+
import {
6+
getTutorialConfig,
7+
totalSteps
8+
} from './tutorialSteps'
69

710
import Library from '../containers/Library'
811
import Logo from './Logo'
@@ -79,7 +82,7 @@ export default class Tutorial extends Component {
7982
HtmlElement="h2"
8083
message="tutorial"
8184
/>
82-
<h3>{ step }</h3>
85+
<h3>{ step } / { totalSteps() }</h3>
8386
<div
8487
dangerouslySetInnerHTML={
8588
{ __html: getMessage(locale, `tutorialSteps.${step}`) }

src/components/tutorialSteps.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ const tutorialSteps = {
3232
}
3333

3434
export const getTutorialConfig = (step) => tutorialSteps[step]
35+
36+
export const totalSteps = () => Object.keys(tutorialSteps).length

0 commit comments

Comments
 (0)