Skip to content

Commit 31a22f0

Browse files
committed
refactor: move className and showButtons to popover object
1 parent fda2bc3 commit 31a22f0

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/simulator/src/tutorials.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ import Driver from 'driver.js'
44
* Each step highlights a UI element and displays contextual guidance.
55
*/
66

7-
export const tour: (Driver.Step & { className?: string })[] = [
7+
export const tour: Driver.Step [] = [
88
{
99
element: '#guide_1',
10-
className: 'guide_1',
1110
popover: {
12-
className: '',
11+
className: 'guide_1',
1312
title: 'Circuit Elements panel',
1413
description:
1514
'This is where you can find all the circuit elements that are offered to build amazing circuits.',
@@ -106,11 +105,10 @@ export const tutorialWrapper = (): void => {
106105
if (!(target instanceof HTMLElement)) return
107106
const sibling = target.nextElementSibling as HTMLElement | null
108107
const siblingHeight = sibling ? sibling.offsetHeight : 0
109-
type StepWithButtons = Driver.Step & { showButtons?: boolean }
110-
const step: StepWithButtons = {
108+
const step: Driver.Step = {
111109
element: '#guide_1',
112-
showButtons: false,
113110
popover: {
111+
showButtons: false,
114112
title: 'Here are the elements',
115113
description:
116114
'Select any element by clicking on it & then click anywhere on the grid to place the element.',
@@ -119,7 +117,7 @@ export const tutorialWrapper = (): void => {
119117
siblingHeight + target.offsetTop - 45,
120118
},
121119
}
122-
panelHighlight.highlight(step as Driver.Step)
120+
panelHighlight.highlight(step)
123121
localStorage.setItem('tutorials', 'done')
124122
}
125123
}, {

0 commit comments

Comments
 (0)