Created
May 20, 2019 01:37
-
-
Save winfamy/e96170510a555d50bb98f70b077ac270 to your computer and use it in GitHub Desktop.
Spread operators are OP af
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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