",
- "main": "dist/cjs/react-alert-template-basic.js",
- "module": "dist/esm/react-alert-template-basic.js",
+ "main": "dist/cjs/react-alert-template-basic-with-icons.js",
+ "module": "dist/esm/react-alert-template-basic-with-icons.js",
"license": "MIT",
"repository": {
"type": "git",
- "url": "https://github.com/schiehll/react-alert-template-basic.git"
+ "url": "https://github.com/jeronimomora/react-alert-template-basic.git"
},
"keywords": [
"react",
@@ -16,7 +16,9 @@
"toaster",
"react-toaster",
"react-component",
- "react-alert-template"
+ "react-alert-template",
+ "react-alert-template-basic",
+ "react-alert-template-basc-with-icons"
],
"scripts": {
"build": "node ./scripts/build.js",
diff --git a/src/AlertTemplate.js b/src/AlertTemplate.js
new file mode 100644
index 0000000..0c7718f
--- /dev/null
+++ b/src/AlertTemplate.js
@@ -0,0 +1,48 @@
+import React from 'react'
+import { InfoIcon, SuccessIcon, ErrorIcon, CloseIcon } from './icons'
+
+const defaultAlertStyle = {
+ backgroundColor: '#151515',
+ color: 'white',
+ padding: '10px',
+ textTransform: 'uppercase',
+ borderRadius: '3px',
+ display: 'flex',
+ justifyContent: 'space-between',
+ alignItems: 'center',
+ boxShadow: '0px 2px 2px 2px rgba(0, 0, 0, 0.03)',
+ fontFamily: 'Arial',
+ width: '300px',
+ boxSizing: 'border-box'
+}
+
+const defaultButtonStyle = {
+ marginLeft: '20px',
+ border: 'none',
+ backgroundColor: 'transparent',
+ cursor: 'pointer',
+ color: '#FFFFFF'
+}
+
+const AlertTemplate = ({
+ message,
+ options,
+ style,
+ buttonStyle = defaultButtonStyle,
+ iconColors = {},
+ close
+}) => {
+ return (
+
+ {options.type === 'info' && }
+ {options.type === 'success' && }
+ {options.type === 'error' && }
+ {message}
+
+
+ )
+}
+
+export default AlertTemplate
\ No newline at end of file
diff --git a/src/icons/CloseIcon.js b/src/icons/CloseIcon.js
index 101020c..a18a335 100644
--- a/src/icons/CloseIcon.js
+++ b/src/icons/CloseIcon.js
@@ -1,8 +1,8 @@
import React from 'react'
import BaseIcon from './BaseIcon'
-const CloseIcon = () => (
-
+const CloseIcon = ({ color = '#FFFFFF' }) => (
+
diff --git a/src/icons/ErrorIcon.js b/src/icons/ErrorIcon.js
index 00f2e4a..2551401 100644
--- a/src/icons/ErrorIcon.js
+++ b/src/icons/ErrorIcon.js
@@ -1,8 +1,8 @@
import React from 'react'
import BaseIcon from './BaseIcon'
-const ErrorIcon = () => (
-
+const ErrorIcon = ({ color = '#FF0040' }) => (
+
diff --git a/src/icons/InfoIcon.js b/src/icons/InfoIcon.js
index b1fb0d6..3da21f6 100644
--- a/src/icons/InfoIcon.js
+++ b/src/icons/InfoIcon.js
@@ -1,8 +1,8 @@
import React from 'react'
import BaseIcon from './BaseIcon'
-const InfoIcon = () => (
-
+const InfoIcon = ({ color = '#2E9AFE' }) => (
+
diff --git a/src/icons/SuccessIcon.js b/src/icons/SuccessIcon.js
index a210adb..f4901a9 100644
--- a/src/icons/SuccessIcon.js
+++ b/src/icons/SuccessIcon.js
@@ -1,8 +1,8 @@
import React from 'react'
import BaseIcon from './BaseIcon'
-const SuccessIcon = () => (
-
+const SuccessIcon = ({ color = '#31B404' }) => (
+
diff --git a/src/icons/index.js b/src/icons/index.js
new file mode 100644
index 0000000..6497f5e
--- /dev/null
+++ b/src/icons/index.js
@@ -0,0 +1,7 @@
+import BaseIcon from './BaseIcon'
+import InfoIcon from './InfoIcon'
+import SuccessIcon from './SuccessIcon'
+import ErrorIcon from './ErrorIcon'
+import CloseIcon from './CloseIcon'
+
+export { BaseIcon, InfoIcon, SuccessIcon, ErrorIcon, CloseIcon }
\ No newline at end of file
diff --git a/src/index.js b/src/index.js
index bf5066d..d134e51 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,44 +1,2 @@
-import React from 'react'
-import InfoIcon from './icons/InfoIcon'
-import SuccessIcon from './icons/SuccessIcon'
-import ErrorIcon from './icons/ErrorIcon'
-import CloseIcon from './icons/CloseIcon'
-
-const alertStyle = {
- backgroundColor: '#151515',
- color: 'white',
- padding: '10px',
- textTransform: 'uppercase',
- borderRadius: '3px',
- display: 'flex',
- justifyContent: 'space-between',
- alignItems: 'center',
- boxShadow: '0px 2px 2px 2px rgba(0, 0, 0, 0.03)',
- fontFamily: 'Arial',
- width: '300px',
- boxSizing: 'border-box'
-}
-
-const buttonStyle = {
- marginLeft: '20px',
- border: 'none',
- backgroundColor: 'transparent',
- cursor: 'pointer',
- color: '#FFFFFF'
-}
-
-const AlertTemplate = ({ message, options, style, close }) => {
- return (
-
- {options.type === 'info' && }
- {options.type === 'success' && }
- {options.type === 'error' && }
- {message}
-
-
- )
-}
-
-export default AlertTemplate
+export * from './icons'
+export { default } from './AlertTemplate'
\ No newline at end of file