Updated the alert system

This commit is contained in:
frikky
2020-11-05 17:32:45 +01:00
parent 7b51b9ef22
commit d67bdc7730
2 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -118,7 +118,7 @@ const App = (message, props) => {
const options = { const options = {
timeout: 5000, timeout: 5000,
position: positions.BOTTOM_RIGHT position: positions.TOP_CENTER,
}; };
const includedData = window.location.pathname === "/home" || window.location.pathname === "/features" ? const includedData = window.location.pathname === "/home" || window.location.pathname === "/features" ?
+11 -11
View File
@@ -1,11 +1,12 @@
import React from 'react' import React from 'react'
import InfoIcon from './icons/InfoIcon' import InfoIcon from '@material-ui/icons/Info';
import SuccessIcon from './icons/SuccessIcon' import CheckIcon from '@material-ui/icons/Check';
import ErrorIcon from './icons/ErrorIcon' import ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';
import CloseIcon from './icons/CloseIcon' import CloseIcon from '@material-ui/icons/Close';
import Typography from '@material-ui/core/Typography';
const alertStyle = { const alertStyle = {
backgroundColor: '#151515', backgroundColor: 'rgba(0,0,0,0.9)',
color: 'white', color: 'white',
padding: 15, padding: 15,
textTransform: 'uppercase', textTransform: 'uppercase',
@@ -14,10 +15,9 @@ const alertStyle = {
justifyContent: 'space-between', justifyContent: 'space-between',
alignItems: 'center', alignItems: 'center',
boxShadow: '0px 2px 2px 2px rgba(0, 0, 0, 0.03)', boxShadow: '0px 2px 2px 2px rgba(0, 0, 0, 0.03)',
fontFamily: 'Arial',
width: 400, width: 400,
boxSizing: 'border-box', boxSizing: 'border-box',
zIndex: 10001, zIndex: 100001,
} }
const buttonStyle = { const buttonStyle = {
@@ -31,10 +31,10 @@ const buttonStyle = {
const AlertTemplate = ({ message, options, style, close }) => { const AlertTemplate = ({ message, options, style, close }) => {
return ( return (
<div style={{ ...alertStyle, ...style }}> <div style={{ ...alertStyle, ...style }}>
{options.type === 'info' && <InfoIcon />} {options.type === 'info' && <InfoIcon style={{color: "white"}} />}
{options.type === 'success' && <SuccessIcon />} {options.type === 'success' && <CheckIcon style={{color: "green", }}/>}
{options.type === 'error' && <ErrorIcon />} {options.type === 'error' && <ErrorOutlineIcon style={{color: "red"}} />}
<span style={{ flex: 2 }}>{message}</span> <Typography style={{marginLeft: 15, flex: 2 }}>{message}</Typography>
<button onClick={close} style={buttonStyle}> <button onClick={close} style={buttonStyle}>
<CloseIcon /> <CloseIcon />
</button> </button>