`
+
+## demo
+
+```embed
+const React = require('react');
+const ReactDOM = require('react-dom/server');
+const Base = require('../base');
+const Container = require('../container');
+const Row = require('../row');
+const Column = require('../column');
+const Notificaton = require('./index.js');
+const styles = require('./style.css');
+
+const style = {
+ marginBottom: 0
+}
+
+nmodule.exports = ReactDOM.renderToString(
+
+
+
+
+ This is the warning content
+
+
+
+
+
+
+ This is the question content
+
+
+
+
+
+
+ This is the alert content
+
+
+
+
+);
+```
+
+## usage
+
+```js
+const React = require('react');
+const Notificaton = require('ui/avatar');
+
+module.exports = () => {
+ return (
+
+ This is the warning content
+
+
+ This is the question content
+
+
+ This is the alert content
+
+ );
+}
+```
diff --git a/ui/src/components/notification/index.js b/ui/src/components/notification/index.js
index dc1125d9..88e3258c 100644
--- a/ui/src/components/notification/index.js
+++ b/ui/src/components/notification/index.js
@@ -1,6 +1,6 @@
const constants = require('../../shared/constants');
const fns = require('../../shared/functions');
-const match = require('../../shared/match');
+const composers = require('../../shared/composers');
const React = require('react');
const Styled = require('styled-components');
@@ -12,44 +12,46 @@ const {
remcalc
} = fns;
-const {
- prop: matchProp
-} = match;
-
const {
default: styled
} = Styled;
-const background = matchProp({
- warning: colors.warningLight,
- alert: colors.alertLight,
-}, 'transparent');
+const {
+ baseBox,
+ pseudoEl
+} = composers;
-const border = matchProp({
- warning: colors.warning,
- alert: 'red',
-}, 'none');
+const decorationWidth = remcalc(108);
const StyledNotification = styled.div`
- border-radius: 4px;
- box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.05);
display: inline-block;
- height: 100%;
+ min-height: 100%;
+ position: relative;
+ width: 100%;
- background-color: ${background('type')};
- border: ${border('type')};
+ ${baseBox(0)}
+
+ &::before {
+ background-color: ${props => colors[props.type] || colors.brandPrimary}
+ width: ${decorationWidth};
+ height: 100%;
+
+ ${pseudoEl()}
+ }
`;
const StyledContent = styled.div`
float: left;
- padding: ${remcalc(20)};
+ padding: ${remcalc(18)} 20% ${remcalc(18)} ${remcalc(18)};
+ margin-left: ${decorationWidth};
+ width: 100%;
`;
const Notificaton = ({
children,
className,
style,
- type = ''
+ type
}) => {
return (
(
-
- This is the default content
-
+
+
+ This is the default content
+
+
))
- .add('warning', () => (
-
- This is the warning content
-
+ .add('Success', () => (
+
+
+ This is the success content
+
+
))
- .add('alert', () => (
-
- This is the alert content
-
+ .add('Alert', () => (
+
+
+ This is the alert content
+
+
));
storiesOf('Pagination', module)