Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 6964 Rev 6965
Línea 12... Línea 12...
12
import InsertEmoticonIcon from '@mui/icons-material/InsertEmoticon'
12
import InsertEmoticonIcon from '@mui/icons-material/InsertEmoticon'
Línea 13... Línea 13...
13
 
13
 
14
import Options from '../UI/Option'
14
import Options from '../UI/Option'
15
import Emojione from './emojione/Emojione'
15
import Emojione from './emojione/Emojione'
-
 
16
import FileModal from '../modals/FileModal'
-
 
17
import LoaderContainer from '../UI/LoaderContainer'
Línea 16... Línea 18...
16
import FileModal from '../modals/FileModal'
18
import Spinner from '../UI/Spinner'
17
 
19
 
18
const StyledChatContainer = styled.div`
20
const StyledChatContainer = styled.div`
19
  background-color: var(--bg-color);
21
  background-color: var(--bg-color);
Línea 137... Línea 139...
137
  &:focus {
139
  &:focus {
138
    background: $bg-color-secondary;
140
    background: $bg-color-secondary;
139
  }
141
  }
140
`
142
`
Línea -... Línea 143...
-
 
143
 
-
 
144
const StyledLoader = styled(LoaderContainer)`
-
 
145
  max-height: 50px;
-
 
146
  max-width: 50px;
-
 
147
`
141
 
148
 
142
function messageAreEqual(oldProps, newProps) {
149
function messageAreEqual(oldProps, newProps) {
143
  return oldProps.message.id === newProps.message.id
150
  return oldProps.message.id === newProps.message.id
Línea 144... Línea 151...
144
}
151
}
Línea 189... Línea 196...
189
  return (
196
  return (
190
    <StyledMessageList ref={scrollRef}>
197
    <StyledMessageList ref={scrollRef}>
191
      {messages.map((message) => (
198
      {messages.map((message) => (
192
        <List.Message message={message} key={message.id} />
199
        <List.Message message={message} key={message.id} />
193
      ))}
200
      ))}
194
      <hr style={{ opacity: 0 }} ref={loadMoreEl} />
201
      <span ref={loadMoreEl}>.</span>
195
      {loading && <p>Cargando...</p>}
202
      {loading && (
-
 
203
        <StyledLoader>
-
 
204
          <Spinner />
-
 
205
        </StyledLoader>
-
 
206
      )}
196
    </StyledMessageList>
207
    </StyledMessageList>
197
  )
208
  )
198
}
209
}
Línea 199... Línea 210...
199
 
210
 
Línea 277... Línea 288...
277
 
288
 
278
  const sendFile = (file) => {
289
  const sendFile = (file) => {
279
    setIsSending(true)
290
    setIsSending(true)
280
    const formData = new FormData()
291
    const formData = new FormData()
-
 
292
    formData.append('file', file)
Línea 281... Línea 293...
281
    formData.append('file', file)
293
    formData.append('message', ' ')
282
 
294
 
283
    axios
295
    axios
284
      .post(uploadUrl, formData)
296
      .post(uploadUrl, formData)