fleet/frontend/components/FlashMessage/styles.js
Mike Stone db57aaa1fc Filter unchanged attributes when updating user (#293)
* Only send changed user attributes to the server

* Improve flash message styles

* Do not allow admins to demote or disable their own account

* Disable admin actions against self
2016-10-07 13:07:02 -04:00

49 lines
1.1 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,
};
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%',
cursor: 'pointer',
height: '30px',
textAlign: 'center',
width: '30px',
};
},
undoStyles: {
cursor: 'pointer',
},
};