-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathindex.tsx
42 lines (37 loc) · 1.06 KB
/
index.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
import React from 'react';
import { inject, observer } from 'mobx-react';
import { NotificationStore } from '@stores/index';
interface IProps {
notificationStore?: NotificationStore;
}
const styles = {
position: 'fixed' as any,
top: '50px',
right: '32px',
zIndex: '10000' as any,
color: '#9BA6B1',
fontSize: '12px',
cursor: 'pointer'
};
@inject('notificationStore')
@observer
export class Notices extends React.Component<IProps> {
render() {
const notificationStore = this.props.notificationStore;
return (
<div className="notices-container">
{notificationStore!.count() > 1
? (<div
className="notices-close-all"
style={styles}
onClick={()=>notificationStore?.closeAll()}>
close all
</div>
)
: null
}
<div className="notices-list-container"></div>
</div>
);
}
}