Skip to content

Commit

Permalink
fix: improve steps for demo guide toggle topic (#3728)
Browse files Browse the repository at this point in the history
https://linear.app/unleash/issue/2-1006/steps-improvement-enabledisable-a-feature-toggle

Step improvements for the "toggle" topic.
Includes a smarter "Next" label that can also be "Start" or "Finish"
depending (nice-to-have).

Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item:
#3537
  • Loading branch information
nunogois committed May 9, 2023
1 parent be11c08 commit 9d680a7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Expand Up @@ -86,6 +86,13 @@ export const DemoStepTooltip = ({
onBack,
onNext,
}: IDemoStepTooltipProps) => {
const nextLabel =
stepIndex === 0
? 'Start'
: stepIndex === topics[topic].steps.length - 1
? 'Finish'
: 'Next';

if (step.target === 'body') {
return (
<div {...tooltipProps}>
Expand Down Expand Up @@ -136,11 +143,7 @@ export const DemoStepTooltip = ({
sx={{ alignSelf: 'flex-end' }}
data-testid="DEMO_NEXT_BUTTON"
>
{topic === topics.length - 1 &&
stepIndex ===
topics[topic].steps.length - 1
? 'Finish'
: 'Next'}
{nextLabel}
</Button>
}
/>
Expand Down Expand Up @@ -192,10 +195,7 @@ export const DemoStepTooltip = ({
sx={{ alignSelf: 'flex-end' }}
data-testid="DEMO_NEXT_BUTTON"
>
{topic === topics.length - 1 &&
stepIndex === topics[topic].steps.length - 1
? 'Finish'
: 'Next'}
{nextLabel}
</Button>
}
/>
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/component/demo/demo-topics.tsx
Expand Up @@ -69,11 +69,11 @@ export const TOPICS: ITutorialTopic[] = [
content: (
<>
<Description>
The simplest way to use a feature toggle is to
enable or disable it for everyone (on/off).
Enable or disable the feature for everyone by
toggling the highlighted switch.
</Description>
<Badge sx={{ mt: 2 }} icon={<InfoOutlinedIcon />}>
Look at the demo page when toggling!
Look at the demo page to see your changes!
</Badge>
</>
),
Expand Down

0 comments on commit 9d680a7

Please sign in to comment.