Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3634 Rev 3719
Línea 1... Línea 1...
1
import React from 'react';
1
import React from 'react';
2
import { Grid } from '@mui/material';
2
import { Grid } from '@mui/material';
3
 
3
 
4
import { useConversations } from '@inmail/hooks';
4
import { useConversations } from '@inmail/hooks';
5
 
5
 
6
import { Spinner } from '@shared/components';
6
import { Spinner } from '@shared/components';
7
import { ConversationsList, MessagesList } from '@inmail/components';
7
import { ConversationsList, MessagesList } from '@inmail/components';
8
 
8
 
9
export const InmailPage = () => {
9
const InmailPage = () => {
10
  const {
10
  const {
11
    conversations,
11
    conversations,
12
    currentConversation,
12
    currentConversation,
13
    loading,
13
    loading,
14
    setCurrentConversation,
14
    setCurrentConversation,
15
    deleteConversation,
15
    deleteConversation,
16
    startConversation
16
    startConversation
17
  } = useConversations();
17
  } = useConversations();
18
 
18
 
19
  if (loading) return <Spinner />;
19
  if (loading) return <Spinner />;
20
 
20
 
21
  return (
21
  return (
22
    <Grid container spacing={1}>
22
    <Grid container spacing={1}>
23
      <Grid
23
      <Grid
24
        item
-
 
25
        xs={12}
24
        size={{ xs: 12, md: 4 }}
26
        md={4}
-
 
27
        sx={{
25
        sx={{
28
          display: { xs: currentConversation ? 'none' : 'block', md: 'block' }
26
          display: { xs: currentConversation ? 'none' : 'block', md: 'block' }
29
        }}
27
        }}
30
      >
28
      >
31
        <ConversationsList
29
        <ConversationsList
32
          conversations={conversations}
30
          conversations={conversations}
33
          onSelectConversation={setCurrentConversation}
31
          onSelectConversation={setCurrentConversation}
34
          onStartConversation={startConversation}
32
          onStartConversation={startConversation}
35
        />
33
        />
36
      </Grid>
34
      </Grid>
37
 
35
 
38
      <Grid
36
      <Grid
39
        item
-
 
40
        xs={12}
37
        size={{ xs: 12, md: 8 }}
41
        md={8}
-
 
42
        sx={{
38
        sx={{
43
          display: { xs: currentConversation ? 'block' : 'none', md: 'block' }
39
          display: { xs: currentConversation ? 'block' : 'none', md: 'block' }
44
        }}
40
        }}
45
      >
41
      >
46
        <MessagesList
42
        <MessagesList
47
          conversation={currentConversation}
43
          conversation={currentConversation}
48
          onClose={setCurrentConversation}
44
          onClose={setCurrentConversation}
49
          onDelete={deleteConversation}
45
          onDelete={deleteConversation}
50
        />
46
        />
51
      </Grid>
47
      </Grid>
52
    </Grid>
48
    </Grid>
53
  );
49
  );
54
};
50
};
-
 
51
 
-
 
52
export default InmailPage;