[ABANDONED] React/Redux front end for the Flexor social network.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
import React, { FC } from 'react' import { useTheme } from '../hooks' import { NotificationType, FormNotification } from '../types'
interface Props { notification: FormNotification }
const Notification: FC<Props> = ({ notification }) => { const theme = useTheme() let color = theme.text
switch (notification.type) { case NotificationType.Error: color = theme.red break case NotificationType.Success: color = theme.green }
return ( <p className="help" style={{ color }}>{notification.message}</p> ) }
export default Notification
|