@magic-modules/messages
v0.0.4
Published
@magic messages module. shows one popup for each message in your app.state.
Downloads
2
Maintainers
Readme
@magic-modules/messages
shows messages with arbitrary types. supports info, success, warning and error messages out of the box, and it's easy to add new message types.
install:
npm install --save-exact @magic-modules/messages
usage:
HOIST in config.mjs
export default {
// ...other config
HOIST: ['Messages'],
}
add message type:
export const View = () => {
const msg = {
type: 'newType',
title: 'newType title',
content: 'newType content',
duration: 5,
}
return button({ onclick: [actions.messages.add, msg] })
}
// needed in the ssr step for now,
// gets overwritten by @magic-modules/messages with the correct actions.
export const actions = {
messages: {},
}
export const style = vars => ({
'.Messages': {
'.Message.newType': {
h3: {
color: vars.colors.pink[900],
},
},
},
}
})
changelog
0.0.1 - unreleased
first release
0.0.2
bump required node version to 14.15.4
0.0.3
update dependencies (@magic-libraries/db)
0.0.4
update dependencies (@magic-libraries/db)
0.0.5 - unreleased
...