Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3736 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
3736 stevensc 1
import React from 'react';
2
 
3
import { useNotificationSettings } from '@account-settings/hooks';
4
 
5
import SwitchInput from '@components/UI/SwitchInput';
6
import { Form, FormButton } from '@shared/components';
7
import { SettingsWidget } from '@account-settings/components';
8
 
9
const Notifications = () => {
10
  const { notifications, handleChecked, updateSettings } = useNotificationSettings();
11
 
12
  return (
13
    <SettingsWidget title='Notificaciónes de Correo Electrónico'>
14
      <Form onSubmit={updateSettings}>
3741 stevensc 15
        {Object.keys(notifications).map((key) => {
3736 stevensc 16
          return (
3741 stevensc 17
            <div className='notbat' key={key}>
18
              <span>{notifications[key].label}</span>
3736 stevensc 19
              <SwitchInput
3741 stevensc 20
                isChecked={notifications[key].value}
21
                setValue={(value) => handleChecked(value, key)}
3736 stevensc 22
              />
23
            </div>
24
          );
25
        })}
26
 
27
        <FormButton type='submit'>Guardar</FormButton>
28
      </Form>
29
    </SettingsWidget>
30
  );
31
};
32
 
33
export default Notifications;