Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 6915 Rev 6916
Línea 6... Línea 6...
6
 
6
 
7
import Options from '../UI/Option'
7
import Options from '../UI/Option'
8
import EmptySection from '../UI/EmptySection'
8
import EmptySection from '../UI/EmptySection'
9
import ContactsModal from '../modals/ContactsModal'
9
import ContactsModal from '../modals/ContactsModal'
-
 
10
import CreateGroupModal from '../modals/CreateGroupModal'
Línea 10... Línea 11...
10
import CreateGroupModal from '../modals/CreateGroupModal'
11
import { BottomNavigation, BottomNavigationAction } from '@mui/material'
Línea 11... Línea 12...
11
 
12
 
12
const notifyAudio = new Audio('/audio/chat.mp3')
13
const notifyAudio = new Audio('/audio/chat.mp3')
Línea 21... Línea 22...
21
  const options = [
22
  const options = [
22
    {
23
    {
23
      label: 'Iniciar conversación',
24
      label: 'Iniciar conversación',
24
      action: () => setShowContactModal(!showContactModal),
25
      action: () => setShowContactModal(!showContactModal),
25
    },
26
    },
26
    { label: 'Crear grupo', action: () => setShowGroupModal(true) },
27
    { label: 'Crear grupo', action: () => setShowGroupModal(!showGroupModal) },
27
  ]
28
  ]
Línea 28... Línea 29...
28
 
29
 
29
  const onCreateConversation = (url) => {
30
  const onCreateConversation = (url) => {
30
    const conversation = conversations.find((user) => user.url_send === url)
31
    const conversation = conversations.find((user) => user.url_send === url)
Línea 54... Línea 55...
54
    const { data } = await axios.post(url)
55
    const { data } = await axios.post(url)
55
    return data.success
56
    return data.success
56
  }
57
  }
Línea 57... Línea 58...
57
 
58
 
-
 
59
  const getConversations = useCallback(
58
  const getConversations = useCallback(
60
    () =>
-
 
61
      conversations.filter((conversation) =>
-
 
62
        tab === 'Personas'
-
 
63
          ? conversation.type === 'user'
-
 
64
          : conversation.type === 'group'
59
    () => conversations.filter((conversation) => conversation.type === tab),
65
      ),
60
    [tab, conversations]
66
    [tab, conversations]
Línea 61... Línea 67...
61
  )
67
  )
62
 
68
 
Línea 84... Línea 90...
84
        <div className="position-relative">
90
        <div className="position-relative">
85
          <h1>Chat</h1>
91
          <h1>Chat</h1>
86
          <Options options={options} />
92
          <Options options={options} />
87
        </div>
93
        </div>
Línea 88... Línea 94...
88
 
94
 
89
        <Row>
95
        <BottomNavigation
90
          <Button
96
          showLabels
91
            className={tab === 'user' && 'active-tab'}
97
          value={tab}
92
            onClick={() => setTab('user')}
98
          onChange={(event, newValue) => setTab(newValue)}
93
          >
-
 
94
            Personas
-
 
95
          </Button>
-
 
96
          <Button
99
        >
97
            className={tab === 'group' && 'active-tab'}
100
          <BottomNavigationAction label="Personas" />
98
            onClick={() => setTab('group')}
-
 
99
          >
-
 
100
            Grupos
101
          <BottomNavigationAction label="Grupos" />
101
          </Button>
102
        </BottomNavigation>
102
        </Row>
103
 
103
        <div className="contact__search show">
104
        <div className="contact__search show">
104
          <SearchIcon />
105
          <SearchIcon />
105
          <input
106
          <input
106
            type="text"
107
            type="text"