Skip to content

Instantly share code, notes, and snippets.

@winfamy
Created May 20, 2019 01:37
Show Gist options
  • Save winfamy/e96170510a555d50bb98f70b077ac270 to your computer and use it in GitHub Desktop.
Save winfamy/e96170510a555d50bb98f70b077ac270 to your computer and use it in GitHub Desktop.
Spread operators are OP af
import toasts from 'izitoast'
const defaultTheme = {
theme: 'dark',
color: '#77848e',
backgroundColor: '#2a2e31',
progressBarColor: '#20c05c',
timeout: 2000,
transitionIn: 'bounceInUp',
transitionOut: 'fadeOutDown'
}
const errorTheme = {
icon: 'fas fa-exclamation-triangle',
iconColor: '#ed4949'
}
const successTheme = {
icon: 'fas fa-check',
iconColor: '#20c05c'
}
export default {
showSuccess: opts => toasts.show({
...defaultTheme,
...successTheme,
...opts
}),
showError: opts => toasts.show({
...defaultTheme,
...errorTheme,
...opts
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment