From 284c5b936eac8216cdcc816957b38bb4acd21abd Mon Sep 17 00:00:00 2001 From: Theodorus Yoga Date: Thu, 19 Sep 2019 19:15:56 +0700 Subject: [PATCH] Revision after review 1 --- snippets/Alert.md | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/snippets/Alert.md b/snippets/Alert.md index e89f5946a..5238d3ef3 100644 --- a/snippets/Alert.md +++ b/snippets/Alert.md @@ -10,7 +10,7 @@ Creates an alert component with `type` prop. - Define `timeoutId` to keep the timer instance for clearing on component unmount. - Use the `React.setEffect()` hook to update the value of `isShown` to `true` and clear interval by using `timeoutId` when component is unmounted. - Define `closeNotification` function to set the component is removed from DOM by displaying fading out animation and set `isShown` to `false` via `setTimeout()`. -- Define the component, which renders alert component with user defined `message` and a close button to remove the component from DOM. +- Define the component, which renders the alert component with user defined `message` and a close button to remove the component from DOM. ```css @keyframes leave { @@ -28,25 +28,13 @@ Creates an alert component with `type` prop. position: relative; } -.alert.success { - color: #155724; - background-color: #d4edda; - border-color: #c3e6cb; -} - -.alert.info{ - color: #004085; - background-color: #cce5ff; - border-color: #b8daff; -} - .alert.warning{ color: #856404; background-color: #fff3cd; border-color: #ffeeba; } -.alert.danger{ +.alert.error{ color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; @@ -69,6 +57,10 @@ Creates an alert component with `type` prop. font-weight: 600; font-size: 16px; } + +.alert .close:after{ + content: 'x'; +} ``` ```jsx @@ -95,7 +87,7 @@ function Notification(props) { return isShown && (
- +
)