Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 6916 Rev 6917
Línea 1... Línea 1...
1
import React, { useCallback, useEffect, useState } from 'react'
1
import React, { useCallback, useEffect, useState } from 'react'
2
import { axios } from '../../utils'
2
import { axios } from '../../utils'
3
import { Button, Row } from 'react-bootstrap'
-
 
4
import { useSelector } from 'react-redux'
3
import { useSelector } from 'react-redux'
-
 
4
import {
-
 
5
  BottomNavigation,
-
 
6
  BottomNavigationAction,
-
 
7
  Tab,
-
 
8
  Tabs,
-
 
9
} from '@mui/material'
5
import SearchIcon from '@mui/icons-material/Search'
10
import SearchIcon from '@mui/icons-material/Search'
Línea 6... Línea 11...
6
 
11
 
7
import Options from '../UI/Option'
12
import Options from '../UI/Option'
8
import EmptySection from '../UI/EmptySection'
13
import EmptySection from '../UI/EmptySection'
9
import ContactsModal from '../modals/ContactsModal'
14
import ContactsModal from '../modals/ContactsModal'
10
import CreateGroupModal from '../modals/CreateGroupModal'
-
 
Línea 11... Línea 15...
11
import { BottomNavigation, BottomNavigationAction } from '@mui/material'
15
import CreateGroupModal from '../modals/CreateGroupModal'
Línea 12... Línea 16...
12
 
16
 
13
const notifyAudio = new Audio('/audio/chat.mp3')
17
const notifyAudio = new Audio('/audio/chat.mp3')
Línea 55... Línea 59...
55
    const { data } = await axios.post(url)
59
    const { data } = await axios.post(url)
56
    return data.success
60
    return data.success
57
  }
61
  }
Línea 58... Línea 62...
58
 
62
 
59
  const getConversations = useCallback(
-
 
60
    () =>
63
  const getConversations = useCallback(
61
      conversations.filter((conversation) =>
-
 
62
        tab === 'Personas'
-
 
63
          ? conversation.type === 'user'
-
 
64
          : conversation.type === 'group'
-
 
65
      ),
64
    () => conversations.filter((conversation) => conversation.type === tab),
66
    [tab, conversations]
65
    [tab, conversations]
Línea 67... Línea 66...
67
  )
66
  )
68
 
67
 
Línea 90... Línea 89...
90
        <div className="position-relative">
89
        <div className="position-relative">
91
          <h1>Chat</h1>
90
          <h1>Chat</h1>
92
          <Options options={options} />
91
          <Options options={options} />
93
        </div>
92
        </div>
Línea 94... Línea -...
94
 
-
 
95
        <BottomNavigation
-
 
96
          showLabels
-
 
97
          value={tab}
93
 
98
          onChange={(event, newValue) => setTab(newValue)}
-
 
99
        >
94
        <Tabs value={tab} onChange={(event, newValue) => setTab(newValue)}>
100
          <BottomNavigationAction label="Personas" />
95
          <Tab label="Personas" value="user" />
101
          <BottomNavigationAction label="Grupos" />
96
          <Tab label="Grupos" value="group" />
Línea 102... Línea 97...
102
        </BottomNavigation>
97
        </Tabs>
103
 
98
 
104
        <div className="contact__search show">
99
        <div className="contact__search show">
105
          <SearchIcon />
100
          <SearchIcon />