Skip to content

Commit

Permalink
examples for hiding components
Browse files Browse the repository at this point in the history
  • Loading branch information
Eitan Elbaz committed Jun 27, 2023
1 parent 6360d09 commit 1addd91
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions playground/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ const App = () => (
<Route path={Routes.custom}>
<CustomExample />
</Route>
<Route path={Routes.home}>
<Home />
</Route>
<Route path={Routes.hiddenComponents}>
<HiddenComponents />
</Route>
<Route path={Routes.home}>
<Home />
</Route>
</Switch>
</BrowserRouter>
</ThemeProvider>
Expand Down
5 changes: 1 addition & 4 deletions playground/src/pages/HiddenComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import Hero from 'components/Hero';
import { HiddenComponentsTour } from 'tours';

const HiddenComponents = () => (
<ReactGrandTour
steps={HiddenComponentsTour}
componentVisibility={{ hideCurrentStepLabel: true }}
>
<ReactGrandTour steps={HiddenComponentsTour}>
<Box
display="flex"
alignItems="center"
Expand Down
10 changes: 7 additions & 3 deletions playground/src/tours/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,20 +164,24 @@ export const HiddenComponentsTour: ReactGrandTourStep[] = [
// },
{
selector: `#${HomeStepIds.one}`,
content: 'Welcome to React Grand Tour!',
content: "Welcome to React Grand Tour! I'm hiding the current step label on this step.",
preferredModalPosition: 'bottom',
hideCurrentStepLabel: true,
},
{
selector: `#${HomeStepIds.two}`,
content:
"And this is a cool logo. Try scrolling down the page. You'll see an arrow appear. You can click anywhere in this modal to be taken back to the highlighted area.",
"And this is a cool logo. Try scrolling down the page. You'll see an arrow appear. You can click anywhere in this modal to be taken back to the highlighted area.\n\n I'm hiding the next & previous step buttons, but you can still use the arrow keys.",
hideNextStepButton: true,
hidePreviousStepButton: true,
},
{
selector: `#${HomeStepIds.three}`,
content: 'The highlighted area will track moving objects',
content:
"The highlighted area will track moving objects. I'm hiding the step buttons here for fun",
track: true,
preferredModalPosition: 'right',
hideStepButtons: true,
},
{
selector: `#${HomeStepIds.four}`,
Expand Down

0 comments on commit 1addd91

Please sign in to comment.