Rev 4640 | Rev 5861 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
/* eslint-disable react/prop-types */
import React, { useState } from "react";
import { connect } from "react-redux";
import { addNotification } from "../../../../../../redux/notification/notification.actions";
import GroupActions from "../../../../../view/templates/linkedin/components/GroupActions";
import Accessibility from "../components/accessibility/Accessibility";
import Industry from "../components/industry/Industry";
import Overview from "../components/overview/Overview";
import Privacy from "../components/privacy/Privacy";
import Type from "../components/type/Type";
import Website from "../components/website/Website";
import '../styles/index.scss'
const Edit = (props) => {
const {
groupId,
overview,
groupType,
groupTypes,
industry,
industries,
privacy,
privacies,
accessibility,
accessibilities,
website,
} = props.backendVars;
// redux destructuring
const { addNotification } = props;
const [settedPrivacy, setSettedPrivacy] = useState(privacy);
const [settedAccesibility, setSettedAccesibility] = useState(accessibility);
return (
<main className="w-100">
<div className="container">
<div className="main d-flex flex-column" style={{ gap: '1rem' }}>
<GroupActions {...props.backendVars} />
<Overview
groupId={groupId}
overview={overview}
addNotification={addNotification}
/>
<Type
groupId={groupId}
groupType={groupType}
groupTypes={groupTypes}
addNotification={addNotification}
/>
<Industry
groupId={groupId}
industry={industry}
industries={industries}
addNotification={addNotification}
/>
<Privacy
groupId={groupId}
privacy={privacy}
privacies={privacies}
addNotification={addNotification}
setSettedPrivacy={setSettedPrivacy}
settedPrivacy={settedPrivacy}
setSettedAccesibility={setSettedAccesibility}
/>
<Accessibility
groupId={groupId}
accessibility={settedAccesibility}
accessibilities={accessibilities}
addNotification={addNotification}
privacy={settedPrivacy}
setSettedAccesibility={setSettedAccesibility}
/>
<Website
groupId={groupId}
website={website}
addNotification={addNotification}
/>
</div>
</div>
</main>
);
};
const mapDispatchToProps = {
addNotification: (notification) => addNotification(notification),
};
export default connect(null, mapDispatchToProps)(Edit);