Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev Autor Línea Nro. Línea
4638 stevensc 1
/* eslint-disable react/prop-types */
5861 stevensc 2
import React, { useState } from 'react'
3
import { connect } from 'react-redux'
4
import { addNotification } from '../../../../../../redux/notification/notification.actions'
5
import GroupActions from '../../../../../view/templates/linkedin/components/GroupActions'
6
import Accessibility from '../components/accessibility/Accessibility'
7
import Industry from '../components/industry/Industry'
8
import Overview from '../components/overview/Overview'
9
import Privacy from '../components/privacy/Privacy'
10
import Type from '../components/type/Type'
11
import Website from '../components/website/Website'
4648 stevensc 12
import '../styles/index.scss'
4638 stevensc 13
 
14
const Edit = (props) => {
5861 stevensc 15
  const {
16
    groupId,
17
    overview,
18
    groupType,
19
    groupTypes,
20
    industry,
21
    industries,
22
    privacy,
23
    privacies,
24
    accessibility,
25
    accessibilities,
26
    website,
5865 stevensc 27
  } = props.backendVars
28
 
29
  // redux destructuring
30
  const { addNotification } = props
31
 
5861 stevensc 32
  const [settedPrivacy, setSettedPrivacy] = useState(privacy)
33
  const [settedAccesibility, setSettedAccesibility] = useState(accessibility)
4638 stevensc 34
 
5861 stevensc 35
  return (
36
    <main className="w-100">
37
      <div className="container">
38
        <div className="main d-flex flex-column" style={{ gap: '1rem' }}>
5865 stevensc 39
          <GroupActions {...props.backendVars} />
5861 stevensc 40
          <Overview
41
            groupId={groupId}
42
            overview={overview}
43
            addNotification={addNotification}
44
          />
45
          <Type
46
            groupId={groupId}
47
            groupType={groupType}
48
            groupTypes={groupTypes}
49
            addNotification={addNotification}
50
          />
51
          <Industry
52
            groupId={groupId}
53
            industry={industry}
54
            industries={industries}
55
            addNotification={addNotification}
56
          />
57
          <Privacy
58
            groupId={groupId}
59
            privacy={privacy}
60
            privacies={privacies}
61
            addNotification={addNotification}
62
            setSettedPrivacy={setSettedPrivacy}
63
            settedPrivacy={settedPrivacy}
64
            setSettedAccesibility={setSettedAccesibility}
65
          />
66
          <Accessibility
67
            groupId={groupId}
68
            accessibility={settedAccesibility}
69
            accessibilities={accessibilities}
70
            addNotification={addNotification}
71
            privacy={settedPrivacy}
72
            setSettedAccesibility={setSettedAccesibility}
73
          />
74
          <Website
75
            groupId={groupId}
76
            website={website}
77
            addNotification={addNotification}
78
          />
79
        </div>
80
      </div>
81
    </main>
82
  )
83
}
4638 stevensc 84
 
85
const mapDispatchToProps = {
5861 stevensc 86
  addNotification: (notification) => addNotification(notification),
87
}
4638 stevensc 88
 
5861 stevensc 89
export default connect(null, mapDispatchToProps)(Edit)