Created
June 3, 2019 15:25
-
-
Save jaouadballat/4a0fb310d86f5fae85c40a515ca675e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect, useState } from 'react'; | |
import './index.css'; | |
export const Flash = () => { | |
let [visibility, setVisibility] = useState(false); | |
let [message, setMessage] = useState(''); | |
let [type, setType] = useState(''); | |
return ( | |
visibility && <div className={`alert alert-${type}`}> | |
<span className="close"><strong>X</strong></span> | |
<p>{message}</p> | |
</div> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment