-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.ts
executable file
·51 lines (47 loc) · 1013 Bytes
/
constants.ts
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
import { NotifyOpts, NotifyPosition } from './types'
export interface IConstants {
notification: Partial<NotifyOpts>
testing: {
containerTestId: (position: NotifyPosition) => string
portalTestId: string
itemTestId: string
itemId: (id: number) => string
}
positions: {
[key: string]: NotifyPosition
}
[key: string]: any
}
export const CONSTANTS: IConstants = {
// Positions
positions: {
tl: 'tl',
tr: 'tr',
tc: 'tc',
bl: 'bl',
br: 'br',
bc: 'bc'
},
// Levels
levels: {
success: 'success',
error: 'error',
warning: 'warning',
info: 'info'
},
// Notification defaults
notification: {
title: '',
message: '',
position: 'tr',
autoDismiss: 5,
dismissible: 'both',
action: undefined
},
testing: {
containerTestId: (position: NotifyPosition) => `notify-container-${position}`,
portalTestId: 'notify-portal',
itemTestId: 'notify-item',
itemId: (id: number) => `notify-item-${id}`
}
}