Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2780 | Rev 3156 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 2780 Rev 2951
Línea 1... Línea 1...
1
import React, { useMemo, useState } from 'react'
1
import React, { useMemo, useState } from 'react'
2
import { useDispatch, useSelector } from 'react-redux'
2
import { useDispatch, useSelector } from 'react-redux'
3
import {
3
import {
4
  Avatar,
4
  Avatar,
5
  List,
5
  List,
6
  ListItem,
-
 
7
  ListItemAvatar,
6
  ListItemAvatar,
8
  ListItemButton,
7
  ListItemButton,
9
  ListItemText,
8
  ListItemText,
10
  Typography
9
  Typography
11
} from '@mui/material'
10
} from '@mui/material'
Línea 56... Línea 55...
56
 
55
 
57
  return (
56
  return (
58
    <Widget>
57
    <Widget>
59
      <Widget.Header
58
      <Widget.Header
60
        title={labels.connect_with + ':'}
59
        title={labels.connect_with + ':'}
61
        renderAction={() => {
60
        renderAction={() =>
62
          if (peopleYouMayKnow.length <= 4) return null
-
 
63
          return (
61
          peopleYouMayKnow.length > 4 && (
64
            <Button onClick={() => setLookMore(!lookMore)}>
62
            <Button onClick={() => setLookMore(!lookMore)}>
65
              {lookMore ? labels.view_less : labels.view_more}
63
              {lookMore ? labels.view_less : labels.view_more}
66
            </Button>
64
            </Button>
67
          )
65
          )
68
        }}
66
        }
Línea 69... Línea 67...
69
      />
67
      />
70
 
68
 
71
      <Widget.Body>
69
      <Widget.Body>
Línea 75... Línea 73...
75
          </Typography>
73
          </Typography>
76
        ) : (
74
        ) : (
77
          <List sx={{ width: '100%', maxHeight: 200, overflow: 'auto' }}>
75
          <List sx={{ width: '100%', maxHeight: 200, overflow: 'auto' }}>
78
            {users.map(
76
            {users.map(
79
              ({ id, image, link_cancel, link_request, name, profile }) => (
77
              ({ id, image, link_cancel, link_request, name, profile }) => (
80
                <ListItem key={id} disablePadding disableRipple>
-
 
81
                  <ListItemButton disableRipple>
78
                <ListItemButton key={id}>
82
                    <ListItemAvatar>
79
                  <ListItemAvatar>
83
                      <Avatar alt={`${name} image`} src={image} />
80
                    <Avatar alt={`${name} image`} src={image} />
84
                    </ListItemAvatar>
81
                  </ListItemAvatar>
85
 
82
 
86
                    <ListItemText primary={name} />
83
                  <ListItemText primary={name} />
87
 
84
 
88
                    {link_request && (
85
                  {link_request && (
89
                      <Button
86
                    <Button
90
                        variant='primary'
87
                      variant='primary'
91
                        onClick={() => handleConnect(link_request)}
88
                      onClick={() => handleConnect(link_request)}
92
                      >
89
                    >
93
                        {labels.connect}
90
                      {labels.connect}
94
                      </Button>
91
                    </Button>
95
                    )}
92
                  )}
96
                    {link_cancel && (
93
                  {link_cancel && (
97
                      <Button
94
                    <Button
98
                        variant='secondary'
95
                      variant='secondary'
99
                        onClick={() => handleConnect(link_cancel)}
96
                      onClick={() => handleConnect(link_cancel)}
100
                      >
97
                    >
101
                        {labels.cancel}
98
                      {labels.cancel}
102
                      </Button>
99
                    </Button>
103
                    )}
100
                  )}
104
                  </ListItemButton>
101
                </ListItemButton>
105
                </ListItem>
-
 
106
              )
102
              )
107
            )}
103
            )}
108
          </List>
104
          </List>
109
        )}
105
        )}
110
      </Widget.Body>
106
      </Widget.Body>