Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3719 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3719 Rev 3736
Línea 1... Línea 1...
1
import React, { useState } from 'react';
1
import React from 'react';
2
import { IconButton, Typography } from '@mui/material';
2
import { IconButton, Typography } from '@mui/material';
3
import { Edit } from '@mui/icons-material';
3
import { Edit } from '@mui/icons-material';
Línea 4... Línea -...
4
 
-
 
5
import Widget from '@components/UI/Widget';
4
 
Línea 6... Línea 5...
6
import WebsiteModal from './website-modal';
5
import { useModal } from '@shared/hooks';
7
 
6
 
Línea -... Línea 7...
-
 
7
import { Card, CardContent, CardHeader } from '@shared/components';
8
const Website = ({ groupId, website, onEdit, edit }) => {
8
import { WebsiteForm } from './WebsiteForm';
Línea 9... Línea -...
9
  const [isModalOpen, setIsModalOpen] = useState(false);
-
 
10
 
-
 
11
  const toggleModal = () => setIsModalOpen(!isModalOpen);
-
 
12
 
-
 
13
  return (
-
 
14
    <>
9
 
15
      <Widget>
-
 
16
        <Widget.Header
-
 
17
          title='Página web'
-
 
18
          renderAction={() => {
-
 
19
            if (!edit) return;
-
 
20
            return (
10
export function Website({ uuid, website, updateGroup, edit }) {
21
              <IconButton onClick={toggleModal}>
-
 
22
                <Edit />
-
 
23
              </IconButton>
-
 
24
            );
-
 
25
          }}
-
 
26
        />
-
 
27
 
11
  const { showModal, closeModal } = useModal();
28
        <Widget.Body>
-
 
29
          <Typography>{website}</Typography>
12
 
30
        </Widget.Body>
13
  const handleEdit = () => {
31
      </Widget>
14
    showModal(
32
 
15
      'Página web',
-
 
16
      <WebsiteForm
33
      <WebsiteModal
17
        uuid={uuid}
34
        show={isModalOpen}
18
        website={website}
35
        website={website}
19
        onSubmit={(data) => {
36
        groupId={groupId}
20
          updateGroup((prev) => ({ ...prev, website: data }));
37
        onClose={toggleModal}
21
          closeModal();
38
        onConfirm={onEdit}
-
 
Línea -... Línea 22...
-
 
22
        }}
-
 
23
      />
-
 
24
    );
-
 
25
  };
-
 
26
 
-
 
27
  return (
-
 
28
    <Card>
-
 
29
      <CardHeader
39
      />
30
        title='Página web'
-
 
31
        renderAction={() => {
-
 
32
          if (!edit) return;
-
 
33
          return (
-
 
34
            <IconButton onClick={handleEdit}>
-
 
35
              <Edit />
-
 
36
            </IconButton>
-
 
37
          );
-
 
38
        }}
-
 
39
      />
-
 
40
 
-
 
41
      <CardContent>