Notification.jsx 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import React from 'react'
  2. import { translate } from 'react-i18next'
  3. import { BtnSwitch } from 'tracim_lib'
  4. import { ROLE } from '../../helper.js'
  5. export const Notification = props => {
  6. const getRole = role => ROLE.find(r => r.name === role)
  7. return (
  8. <div className='account__userpreference__setting__notification'>
  9. <div className='notification__sectiontitle subTitle ml-2 ml-sm-0'>
  10. Espace de Travail & Notification
  11. </div>
  12. <div className='notification__text ml-2 ml-sm-0'>
  13. NYI
  14. </div>
  15. <div className='notification__table'>
  16. <table className='table'>
  17. <thead>
  18. <tr>
  19. <th>Espace de travail</th>
  20. <th>Role</th>
  21. <th>Notification</th>
  22. </tr>
  23. </thead>
  24. <tbody>
  25. { props.workspaceList.map(ws =>
  26. <tr key={ws.id}>
  27. <td>
  28. <div className='notification__table__wksname'>
  29. {ws.title}
  30. </div>
  31. </td>
  32. <td>
  33. <div className='notification__table__role'>
  34. <div className='notification__table__role__icon'>
  35. <i className={`fa ${getRole(ws.role).icon}`} />
  36. </div>
  37. <div className='notification__table__role__text d-none d-sm-flex'>
  38. {props.t(getRole(ws.role).translationKey)}
  39. </div>
  40. </div>
  41. </td>
  42. <td>
  43. <BtnSwitch checked={ws.notif} onChange={() => props.onChangeSubscriptionNotif(ws.id, !ws.notif)} />
  44. </td>
  45. </tr>
  46. )}
  47. </tbody>
  48. </table>
  49. </div>
  50. </div>
  51. )
  52. }
  53. export default translate()(Notification)