mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
* Updates eslint packages * Expected parentheses around arrow function argument having a body with curly braces * Prop type `object` is forbidden * Visible, non-interactive elements should not have mouse or keyboard event listeners * Prop type is defined but not used * Unexpected use of file extension "jsx" * Expected 'this' to be used by class method * HTML entities must be escaped * Prevent default behavior on more options button click
59 lines
1.3 KiB
JavaScript
59 lines
1.3 KiB
JavaScript
import Style from '../../styles';
|
|
|
|
const { color, padding } = Style;
|
|
|
|
export default {
|
|
containerStyles: (alertType) => {
|
|
const successAlert = { backgroundColor: color.success };
|
|
const errorAlert = { backgroundColor: color.alert };
|
|
const baseStyles = {
|
|
alignItems: 'center',
|
|
color: color.white,
|
|
display: 'flex',
|
|
height: '50px',
|
|
justifyContent: 'space-between',
|
|
paddingLeft: padding.half,
|
|
paddingRight: padding.half,
|
|
position: 'fixed',
|
|
left: '223px',
|
|
right: 0,
|
|
top: 0,
|
|
zIndex: '2',
|
|
'@media (max-width: 760px)': {
|
|
left: '54px',
|
|
},
|
|
};
|
|
|
|
if (alertType === 'success') {
|
|
return { ...baseStyles, ...successAlert };
|
|
}
|
|
|
|
if (alertType === 'error') {
|
|
return { ...baseStyles, ...errorAlert };
|
|
}
|
|
|
|
return {};
|
|
},
|
|
contentStyles: {},
|
|
flashActionStyles: {
|
|
display: 'flex',
|
|
justifyContent: 'space-between',
|
|
width: '96px',
|
|
},
|
|
removeFlashMessageStyles: (alertType) => {
|
|
const backgroundColor = alertType === 'success' ? color.successLight : color.alertLight;
|
|
return {
|
|
backgroundColor,
|
|
borderRadius: '50%',
|
|
color: color.white,
|
|
cursor: 'pointer',
|
|
height: '30px',
|
|
textAlign: 'center',
|
|
width: '30px',
|
|
};
|
|
},
|
|
undoStyles: {
|
|
color: color.white,
|
|
cursor: 'pointer',
|
|
},
|
|
};
|