Skip to content

Instantly share code, notes, and snippets.

@b2whats
Last active July 12, 2018 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save b2whats/b58aeb311b3a4400337ff672762828dc to your computer and use it in GitHub Desktop.
Save b2whats/b58aeb311b3a4400337ff672762828dc to your computer and use it in GitHub Desktop.
Notice
Так мы пушим нотификации из любого места системы, статическое свойство класса.
NotificationManager.addMessage({
id?: number | string,
content: React.Node,
timeout?: number,
onClose?: (event: SyntheticEvent<HTMLElement>) => void
})
<NotificationManager>
<NotificationBox placement='right-start' animation='slide-right' component={FloatingAlert} />
<NotificationBox placement='right-end' animation='slide-right' component={Alert} />
</NotificationManager>
=======================
const config = {
'right-start': {
animation: 'slide-right',
component: FloatingAlert
},
'bottom': {
animation: 'slide-bottom',
component: Alert
}
}
<NotificationManager config={}/>
=======================
<NotificationManager>
{(notifications) => {[
<NotificationBox key='1' placement='right-start' animation='slide-right' component={FloatingAlert} notifications={notifications['right-start']}/>
<NotificationBox key='2' placement='right-end' animation='slide-right' component={Alert} notifications={notifications['right-end']}/>
]}}
</NotificationManager>
=======================
NotificationBox.addMessage
<NotificationBox placement='right-start' animation='slide-right' component={FloatingAlert} />
<NotificationBox placement='right-end' animation='slide-end' component={Alert} />
=======================
NotificationBox.addMessage({
id?: number | string,
content: React.Node,
timeout?: number,
onClose?: (event: SyntheticEvent<HTMLElement>) => void,
...otherProps
})
<NotificationBox placement='right-start' animation='slide-right'>
{(notice) => {
<FloatingAlert onClose={notice.onClose} type={notice.otherProps.type}>
{notice.content}
</FloatingAlert>
}}
</NotificationBox>
Icon.setIcon(name, require)
<Icon name='myName' />
===
Icon.star = require()
<Icon src={Icon.star} />
====
<Icon src={Pack.star} />
====
const MyIcon = (...) => <Icon src={require()} />
====
@b2whats
Copy link
Author

b2whats commented Jul 12, 2018

Icon.setIcon(name, require)

===

Icon.star = require()

====

====

const MyIcon = (...) =>

====

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment