[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.

26 lines
621 B

5 years ago
5 years ago
  1. import React, { FC } from 'react'
  2. import { useTheme } from '../hooks'
  3. import { NotificationType, FormNotification } from '../types'
  4. interface Props {
  5. notification: FormNotification
  6. }
  7. const Notification: FC<Props> = ({ notification }) => {
  8. const theme = useTheme()
  9. let color = theme.text
  10. switch (notification.type) {
  11. case NotificationType.Error:
  12. color = theme.red
  13. break
  14. case NotificationType.Success:
  15. color = theme.green
  16. }
  17. return (
  18. <p className="help" style={{ color }}>{notification.message}</p>
  19. )
  20. }
  21. export default Notification