|
@@ -23,20 +23,35 @@ import { TChats } from '../../../../typescript/redux/chats/types';
|
|
|
|
|
|
|
|
|
|
const useStyles = makeStyles({
|
|
const useStyles = makeStyles({
|
|
- bottomNavigation: {
|
|
|
|
- borderBottom:'solid 2px #dddddd',
|
|
|
|
- height:'7vh'
|
|
|
|
- },
|
|
|
|
- icon: {
|
|
|
|
- fontSize: 17,
|
|
|
|
|
|
+container: {
|
|
|
|
+ height:'7vh',
|
|
|
|
+ borderBottom: 'solid 2px #dddddd',
|
|
|
|
+ display: 'flex',
|
|
|
|
+ justifyContent: 'space-around',
|
|
|
|
+ alignContent: "center",
|
|
|
|
+ alignItems:"center",
|
|
|
|
+ flexWrap: 'nowrap',
|
|
|
|
+ color:'rgba(0, 0, 0, 0.6)'
|
|
|
|
+},
|
|
|
|
+item: {
|
|
|
|
+ height:'100%',
|
|
|
|
+ display: 'flex',
|
|
|
|
+ flexDirection: 'column',
|
|
|
|
+ justifyContent: 'center',
|
|
|
|
+ alignContent: "center",
|
|
|
|
+ alignItems: "center",
|
|
|
|
+ cursor:'pointer',
|
|
|
|
+},
|
|
|
|
+icon: {
|
|
|
|
+ fontSize: '1rem',
|
|
lineHeight: 0,
|
|
lineHeight: 0,
|
|
marginBottom: 0,
|
|
marginBottom: 0,
|
|
fontWeight:600
|
|
fontWeight:600
|
|
},
|
|
},
|
|
- underline: {
|
|
|
|
- fontSize: 45,
|
|
|
|
|
|
+underline: {
|
|
|
|
+ fontSize: '2.2rem',
|
|
lineHeight: 0,
|
|
lineHeight: 0,
|
|
- },
|
|
|
|
|
|
+ },
|
|
})
|
|
})
|
|
|
|
|
|
interface ISearchLists {
|
|
interface ISearchLists {
|
|
@@ -52,12 +67,11 @@ const SearchLists = ({ value,setValue,sort }: ISearchLists) => {
|
|
const messagesMemo = useSelector(getAllMessagesMemo)
|
|
const messagesMemo = useSelector(getAllMessagesMemo)
|
|
const isOpen = useSelector(getIsOpen)
|
|
const isOpen = useSelector(getIsOpen)
|
|
const [isActive, setIsActive] = useState<number>(0)
|
|
const [isActive, setIsActive] = useState<number>(0)
|
|
- const handleIsActive = (_e: React.SyntheticEvent<Element, Event>, newValue: number): void => {
|
|
|
|
|
|
+ const handleIsActive = (newValue: number): void => {
|
|
setIsActive(newValue)
|
|
setIsActive(newValue)
|
|
setValue('')
|
|
setValue('')
|
|
}
|
|
}
|
|
- const Icon = ({ name }: { name: string }) => <span className={classes.icon}>{name}</span>
|
|
|
|
- const Label = () => <span className={classes.underline}>__</span>
|
|
|
|
|
|
+
|
|
const handleListItemClick = (companionId: string) => {
|
|
const handleListItemClick = (companionId: string) => {
|
|
isOpen&&dispatch(actionIsOpen(''))
|
|
isOpen&&dispatch(actionIsOpen(''))
|
|
dispatch(asyncStartChatById(companionId))
|
|
dispatch(asyncStartChatById(companionId))
|
|
@@ -89,19 +103,38 @@ const SearchLists = ({ value,setValue,sort }: ISearchLists) => {
|
|
|
|
|
|
return (
|
|
return (
|
|
<>
|
|
<>
|
|
- <BottomNavigation
|
|
|
|
- showLabels
|
|
|
|
- value={isActive}
|
|
|
|
- onChange={handleIsActive}
|
|
|
|
- className={classes.bottomNavigation}
|
|
|
|
- >
|
|
|
|
- <BottomNavigationAction label={<Label />} icon={<Icon name='Chats' />} />
|
|
|
|
- <BottomNavigationAction label={<Label/>} icon={<Icon name='Files' />} />
|
|
|
|
- <BottomNavigationAction label={<Label />} icon={<Icon name='Media' />} />
|
|
|
|
- <BottomNavigationAction label={<Label/>} icon={<Icon name='Text' />} />
|
|
|
|
- <BottomNavigationAction label={<Label />} icon={<Icon name='Audio' />} />
|
|
|
|
- <BottomNavigationAction label={<Label/>} icon={<Icon name='Video' />} />
|
|
|
|
- </BottomNavigation>
|
|
|
|
|
|
+ <div className={classes.container}>
|
|
|
|
+ <div className={classes.item} style={{color:isActive === 0?'#1976d2':"rgba(0, 0, 0, 0.6)"}}
|
|
|
|
+ onClick={() => handleIsActive(0)}>
|
|
|
|
+ <span className={classes.icon}>Chats</span>
|
|
|
|
+ <span className={classes.underline}>___</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div className={classes.item} style={{color:isActive === 1?'#1976d2':"rgba(0, 0, 0, 0.6)"}}
|
|
|
|
+ onClick={() => handleIsActive(1)}>
|
|
|
|
+ <span className={classes.icon}>Files</span>
|
|
|
|
+ <span className={classes.underline}>___</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div className={classes.item} style={{color:isActive === 2?'#1976d2':"rgba(0, 0, 0, 0.6)"}}
|
|
|
|
+ onClick={() => handleIsActive(2)}>
|
|
|
|
+ <span className={classes.icon}>Media</span>
|
|
|
|
+ <span className={classes.underline}>___</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div className={classes.item} style={{color:isActive === 3?'#1976d2':"rgba(0, 0, 0, 0.6)"}}
|
|
|
|
+ onClick={() => handleIsActive(3)}>
|
|
|
|
+ <span className={classes.icon}>Text</span>
|
|
|
|
+ <span className={classes.underline}>___</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div className={classes.item} style={{color:isActive === 4?'#1976d2':"rgba(0, 0, 0, 0.6)"}}
|
|
|
|
+ onClick={() => handleIsActive(4)}>
|
|
|
|
+ <span className={classes.icon}>Audio</span>
|
|
|
|
+ <span className={classes.underline}>___</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div className={classes.item} style={{color:isActive === 5?'#1976d2':"rgba(0, 0, 0, 0.6)"}}
|
|
|
|
+ onClick={() => handleIsActive(5)}>
|
|
|
|
+ <span className={classes.icon}>Video</span>
|
|
|
|
+ <span className={classes.underline}>___</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
{isActive === 0 && <ChatListRecent value={value}
|
|
{isActive === 0 && <ChatListRecent value={value}
|
|
filteredAndSorted={filteredAndSorted} handleListItemClick={handleListItemClick} />}
|
|
filteredAndSorted={filteredAndSorted} handleListItemClick={handleListItemClick} />}
|
|
{isActive === 1 && <FilesList allMessagesMemo={allMessagesMemo} value={value}/>}
|
|
{isActive === 1 && <FilesList allMessagesMemo={allMessagesMemo} value={value}/>}
|