mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
Feat / Reusable SearchField + Fixed Messages align bottom flex with scroll (first message starts at bottom) (#151)
* feat(phone/ui): Make SearchField a reusable component * Fixed conversation scrolling and align bottom * feat(phone/ui): Autoscroll fix * feat(phone/ui): Autoscroll fix remove unused deps * feat(phone/ui): Autoscroll add needed dep for new messages
This commit is contained in:
1 parent
1659fa1654
commit
e56ae415dc
13 files changed
+162
-196
No files matched your search
@@ -1,17 +1,19 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { List } from '@material-ui/core';
|
||||
import { Box, List } from '@material-ui/core';
|
||||
import { MessageGroup } from '../../../../common/typings/messages';
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
import useMessages from '../../hooks/useMessages';
|
||||
import MessageSearch from './MessageSearch';
|
||||
import MessageGroupItem from './MessageGroupItem';
|
||||
import useStyles from './list.styles';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { goToConversation } from '../../utils/goToConversation';
|
||||
import { SearchField } from '../../../../ui/components/SearchField';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const MessagesList = (): any => {
|
||||
const classes = useStyles();
|
||||
const history = useHistory();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { messageGroups, createMessageGroupResult, clearMessageGroupResult } = useMessages();
|
||||
|
||||
@@ -46,18 +48,28 @@ const MessagesList = (): any => {
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<MessageSearch value={searchValue} handleChange={(e) => setSearchValue(e.target.value)} />
|
||||
<List className={classes.root}>
|
||||
{filteredGroups.map((messageGroup) => (
|
||||
<MessageGroupItem
|
||||
key={messageGroup.groupId}
|
||||
messageGroup={messageGroup}
|
||||
handleClick={handleClick}
|
||||
/>
|
||||
))}
|
||||
</List>
|
||||
</>
|
||||
<Box display="flex" flexDirection="column">
|
||||
<Box>
|
||||
<SearchField
|
||||
value={searchValue}
|
||||
onChange={(e) => setSearchValue(e.target.value)}
|
||||
placeholder={t('APPS_MESSAGES_SEARCH_PLACEHOLDER')}
|
||||
/>
|
||||
</Box>
|
||||
<Box display="flex" flexDirection="column">
|
||||
<Box className={classes.root}>
|
||||
<List>
|
||||
{filteredGroups.map((messageGroup) => (
|
||||
<MessageGroupItem
|
||||
key={messageGroup.groupId}
|
||||
messageGroup={messageGroup}
|
||||
handleClick={handleClick}
|
||||
/>
|
||||
))}
|
||||
</List>
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user