-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathNestedActionDemo.tsx
More file actions
46 lines (44 loc) · 1.46 KB
/
Copy pathNestedActionDemo.tsx
File metadata and controls
46 lines (44 loc) · 1.46 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
import { Component } from 'solid-js';
import { KbdShortcut } from '../../../../../lib';
import { Profile } from '../types';
import demoStyles from '../demoUtils.module.css';
import utilStyles from '../../../../utils.module.css';
import styles from './NestedActionDemo.module.css';
export interface Props {
profile: Profile;
onProfileChange: (event: Event) => void;
}
export const NestedActionDemo: Component<Props> = (p) => {
return (
<section class={demoStyles.demoSection}>
<div>
<h3 class={utilStyles.stripSpace}>Nested actions</h3>
<p>
When user selects an action but wants to further choose an option in it, this comes in
handy.
</p>
<p>
After selecting <strong>Change Profile</strong> action, user can choose between Personal &
Work profiles.
</p>
</div>
<div class={demoStyles.demoInteraction}>
<p class={demoStyles.demoInteractionDesc}>
Active profile is <strong>{p.profile}</strong>
</p>
<select
aria-label="Select Profile"
class={styles.profileMenu}
value={p.profile}
onChange={p.onProfileChange}
>
<option value="personal">Personal</option>
<option value="work">Work</option>
</select>
<p class={demoStyles.demoInteractionDesc}>
Try <KbdShortcut shortcut="p p" /> / <KbdShortcut shortcut="p w" />
</p>
</div>
</section>
);
};