forked from patternfly/react-component-groups
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOnboardingModalDeckDemo.tsx
More file actions
130 lines (124 loc) · 4.28 KB
/
OnboardingModalDeckDemo.tsx
File metadata and controls
130 lines (124 loc) · 4.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/* eslint-disable no-console */
import { FunctionComponent, useState } from 'react';
import Deck, { DeckButton } from '@patternfly/react-component-groups/dist/dynamic/Deck';
import { ModalDeck } from '@patternfly/react-component-groups/dist/dynamic/ModalDeck';
import { Button, ButtonVariant, Label, Title, Stack, StackItem, Content } from '@patternfly/react-core';
export const OnboardingModalDeckDemo: FunctionComponent = () => {
const [ isModalOpen, setIsModalOpen ] = useState(false);
const handleClose = () => {
setIsModalOpen(false);
console.log('Onboarding completed or skipped');
};
// Placeholder for illustration - in a real app, replace with actual images
const placeholderImage = (
<div
style={{
width: '256px',
height: '256px',
borderRadius: '8px',
background: 'repeating-linear-gradient(45deg, #f3f4f6, #f3f4f6 10px, #e5e7eb 10px, #e5e7eb 20px)',
opacity: 0.25,
margin: 'auto'
}}
/>
);
const pages = [
{
content: (
<Stack hasGutter>
<StackItem>{placeholderImage}</StackItem>
<StackItem>
<Title headingLevel="h2" size="2xl">Welcome to [Product Name]</Title>
</StackItem>
<StackItem>
<Content component="p">
Harness the full potential of the hybrid cloud, simply by asking.
</Content>
</StackItem>
</Stack>
),
buttons: [
{
children: 'Continue',
variant: ButtonVariant.primary,
navigation: 'next'
}
] as DeckButton[]
},
{
content: (
<Stack hasGutter>
<StackItem>{placeholderImage}</StackItem>
<StackItem><Label color="grey">AI Command Center</Label></StackItem>
<StackItem><Title headingLevel="h2" size="2xl">Intelligence at your command</Title></StackItem>
<StackItem><Content component="p">Ask anything. Get answers. Troubleshoot, analyze, and understand your entire fleet just by asking. It's the power of your data, in plain language.</Content></StackItem>
</Stack>
),
buttons: [
{
children: 'Continue',
variant: ButtonVariant.primary,
navigation: 'next'
}
] as DeckButton[]
},
{
content: (
<Stack hasGutter>
<StackItem>{placeholderImage}</StackItem>
<StackItem><Label color="grey">Canvas Mode</Label></StackItem>
<StackItem><Title headingLevel="h2" size="2xl">Go from conversation to clarity.</Title></StackItem>
<StackItem><Content component="p">Transform answers into custom dashboards. In Canvas Mode, you can effortlessly arrange, customize, and build the precise view you need to monitor what matters most.</Content></StackItem>
</Stack>
),
buttons: [
{
children: 'Continue',
variant: ButtonVariant.primary,
navigation: 'next'
}
] as DeckButton[]
},
{
content: (
<Stack hasGutter>
<StackItem>{placeholderImage}</StackItem>
<StackItem><Label color="grey">Sharing</Label></StackItem>
<StackItem><Title headingLevel="h2" size="2xl">Share your vision. Instantly.</Title></StackItem>
<StackItem><Content component="p">An insight is only powerful when it’s shared. Save any view to your library and share it with your team in a single click. Drive decisions, together.</Content></StackItem>
</Stack>
),
buttons: [
{
children: 'Get started',
variant: ButtonVariant.primary,
navigation: 'close'
}
] as DeckButton[]
}
];
return (
<>
<Button onClick={() => setIsModalOpen(true)}>
Launch onboarding
</Button>
<ModalDeck
isOpen={isModalOpen}
modalProps={{
'aria-label': 'Product onboarding walkthrough'
}}
>
<Deck
pages={pages}
onClose={handleClose}
onPageChange={(index) => console.log('Onboarding page:', index + 1)}
ariaLabel="Product onboarding"
ariaRoleDescription="onboarding walkthrough"
contentFlexProps={{
spaceItems: { default: 'spaceItemsXl' }
}}
/>
</ModalDeck>
</>
);
};