forked from smlxl/evm.codes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuseActions.tsx
64 lines (59 loc) · 1.61 KB
/
useActions.tsx
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
import { useRouter } from 'next/router'
import { GITHUB_REPO_URL } from 'util/constants'
import { Icon } from 'components/ui'
const useActions = () => {
const router = useRouter()
return [
{
id: 'opcodes',
name: 'Opcodes',
shortcut: ['o'],
keywords: 'home opcodes back',
section: 'Navigation',
perform: () => router.push('/'),
subtitle: 'Opcodes reference',
icon: <Icon name="home-2-line" />,
},
{
id: 'precompiled',
name: 'Precompiled',
shortcut: ['a'],
keywords: 'precompiled contracts',
section: 'Navigation',
subtitle: 'Precompiled contracts reference',
perform: () => router.push('/precompiled'),
icon: <Icon name="information-line" />,
},
{
id: 'playground',
name: 'Playground',
shortcut: ['p'],
keywords: 'editor play',
section: 'Navigation',
perform: () => router.push('/playground'),
subtitle: 'Play with EVM in real-time',
icon: <Icon name="play-circle-line" />,
},
{
id: 'about',
name: 'About',
shortcut: ['a'],
keywords: 'about EVM',
section: 'Navigation',
subtitle: 'About EVM and its internals',
perform: () => router.push('/about'),
icon: <Icon name="information-line" />,
},
{
id: 'github',
name: 'GitHub',
shortcut: ['g'],
keywords: 'contribute GitHub issues',
section: 'Navigation',
subtitle: 'Contribute on GitHub',
perform: () => window.open(GITHUB_REPO_URL, '_blank'),
icon: <Icon name="github-fill" />,
},
]
}
export default useActions