mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
Merge branch 'feature/autocomplete-contacts' of https://github.com/project-error/new-phone-who-dis into feature/autocomplete-contacts
This commit is contained in:
commit
f765f35b8c
4 files changed
+109
-15
No files matched your search
@@ -72,6 +72,94 @@ InjectDebugData([
|
|||||||
isMine: false,
|
isMine: false,
|
||||||
updatedAt: Date.now(),
|
updatedAt: Date.now(),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
message: 'sup!',
|
||||||
|
user_identifier: '1234',
|
||||||
|
phone_number: '444-4444',
|
||||||
|
display: 'kidz',
|
||||||
|
avatar: null,
|
||||||
|
isRead: true,
|
||||||
|
isMine: false,
|
||||||
|
updatedAt: Date.now(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
message: 'sup!',
|
||||||
|
user_identifier: '1234',
|
||||||
|
phone_number: '444-4444',
|
||||||
|
display: 'kidz',
|
||||||
|
avatar: null,
|
||||||
|
isRead: true,
|
||||||
|
isMine: false,
|
||||||
|
updatedAt: Date.now(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
message: 'sup!',
|
||||||
|
user_identifier: '1234',
|
||||||
|
phone_number: '444-4444',
|
||||||
|
display: 'kidz',
|
||||||
|
avatar: null,
|
||||||
|
isRead: true,
|
||||||
|
isMine: false,
|
||||||
|
updatedAt: Date.now(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
message: 'sup!',
|
||||||
|
user_identifier: '1234',
|
||||||
|
phone_number: '444-4444',
|
||||||
|
display: 'kidz',
|
||||||
|
avatar: null,
|
||||||
|
isRead: true,
|
||||||
|
isMine: false,
|
||||||
|
updatedAt: Date.now(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
message: 'sup!',
|
||||||
|
user_identifier: '1234',
|
||||||
|
phone_number: '444-4444',
|
||||||
|
display: 'kidz',
|
||||||
|
avatar: null,
|
||||||
|
isRead: true,
|
||||||
|
isMine: false,
|
||||||
|
updatedAt: Date.now(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
message: 'sup!',
|
||||||
|
user_identifier: '1234',
|
||||||
|
phone_number: '444-4444',
|
||||||
|
display: 'kidz',
|
||||||
|
avatar: null,
|
||||||
|
isRead: true,
|
||||||
|
isMine: true,
|
||||||
|
updatedAt: Date.now(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
message: 'sup!',
|
||||||
|
user_identifier: '1234',
|
||||||
|
phone_number: '444-4444',
|
||||||
|
display: 'kidz',
|
||||||
|
avatar: null,
|
||||||
|
isRead: true,
|
||||||
|
isMine: false,
|
||||||
|
updatedAt: Date.now(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
message: 'sup!',
|
||||||
|
user_identifier: '1234',
|
||||||
|
phone_number: '444-4444',
|
||||||
|
display: 'kidz',
|
||||||
|
avatar: null,
|
||||||
|
isRead: true,
|
||||||
|
isMine: true,
|
||||||
|
updatedAt: Date.now(),
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { FormEvent, useState } from 'react';
|
import React, { FormEvent, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Paper, TextField, Button, Box } from '@material-ui/core';
|
import { Paper, TextField, Button, Box, makeStyles } from '@material-ui/core';
|
||||||
import SendIcon from '@material-ui/icons/Send';
|
import SendIcon from '@material-ui/icons/Send';
|
||||||
import ImageIcon from '@material-ui/icons/Image';
|
import ImageIcon from '@material-ui/icons/Image';
|
||||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||||
@@ -10,8 +10,13 @@ interface IProps {
|
|||||||
messageGroupId: string | undefined;
|
messageGroupId: string | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const useStyles = makeStyles({
|
||||||
|
root: { position: 'absolute', bottom: 0, width: '100%' },
|
||||||
|
});
|
||||||
|
|
||||||
const MessageInput = ({ messageGroupId, onAddImageClick }: IProps) => {
|
const MessageInput = ({ messageGroupId, onAddImageClick }: IProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const classes = useStyles();
|
||||||
const [message, setMessage] = useState('');
|
const [message, setMessage] = useState('');
|
||||||
|
|
||||||
const handleSubmit = (event: FormEvent) => {
|
const handleSubmit = (event: FormEvent) => {
|
||||||
@@ -29,7 +34,7 @@ const MessageInput = ({ messageGroupId, onAddImageClick }: IProps) => {
|
|||||||
if (!messageGroupId) return null;
|
if (!messageGroupId) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Paper variant='outlined' style={{ position: 'absolute', bottom: 0, width: '100%' }}>
|
<Paper variant='outlined' className={classes.root}>
|
||||||
<form onSubmit={handleSubmit}>
|
<form onSubmit={handleSubmit}>
|
||||||
<Box display='flex'>
|
<Box display='flex'>
|
||||||
<Box pl={1} flexGrow={1}>
|
<Box pl={1} flexGrow={1}>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Paper, Typography } from '@material-ui/core';
|
import { Box, Paper, Typography } from '@material-ui/core';
|
||||||
|
|
||||||
import { Message, MessageGroup } from '../../../../common/typings/messages';
|
import { Message, MessageGroup } from '../../../../common/typings/messages';
|
||||||
import MessageInput from '../form/MessageInput';
|
import MessageInput from '../form/MessageInput';
|
||||||
@@ -32,9 +32,16 @@ const Conversation = ({ activeMessageGroup, messages }: IProps) => {
|
|||||||
isOpen={imageModalOpen}
|
isOpen={imageModalOpen}
|
||||||
messageGroupId={activeMessageGroup.groupId}
|
messageGroupId={activeMessageGroup.groupId}
|
||||||
/>
|
/>
|
||||||
<div id={CONVERSATION_ELEMENT_ID} className={classes.messageList}>
|
<Box
|
||||||
|
id={CONVERSATION_ELEMENT_ID}
|
||||||
|
height='90%'
|
||||||
|
display='flex'
|
||||||
|
flexDirection='column'
|
||||||
|
pb={4}
|
||||||
|
className={classes.overflowAutoY}
|
||||||
|
>
|
||||||
{messages.map((message) => (
|
{messages.map((message) => (
|
||||||
<div key={message.id} className={classes.messageContainer}>
|
<div key={message.id}>
|
||||||
<Paper
|
<Paper
|
||||||
className={message.isMine ? classes.sourceSms : classes.sms}
|
className={message.isMine ? classes.sourceSms : classes.sms}
|
||||||
variant='outlined'
|
variant='outlined'
|
||||||
@@ -56,7 +63,7 @@ const Conversation = ({ activeMessageGroup, messages }: IProps) => {
|
|||||||
</Paper>
|
</Paper>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</Box>
|
||||||
<MessageInput
|
<MessageInput
|
||||||
messageGroupId={activeMessageGroup.groupId}
|
messageGroupId={activeMessageGroup.groupId}
|
||||||
onAddImageClick={() => setImageModalOpen(true)}
|
onAddImageClick={() => setImageModalOpen(true)}
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
flexFlow: 'row nowrap',
|
flexFlow: 'row nowrap',
|
||||||
padding: '3px 0px',
|
padding: '3px 0px',
|
||||||
},
|
},
|
||||||
|
overflowAutoY: {
|
||||||
|
overflowY: 'auto',
|
||||||
|
},
|
||||||
groupdisplay: {
|
groupdisplay: {
|
||||||
width: '300px',
|
width: '300px',
|
||||||
paddingTop: '8px',
|
paddingTop: '8px',
|
||||||
@@ -28,15 +31,6 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
paddingTop: '8px',
|
paddingTop: '8px',
|
||||||
fontSize: '20px',
|
fontSize: '20px',
|
||||||
},
|
},
|
||||||
messageList: {
|
|
||||||
height: '90%',
|
|
||||||
overflowY: 'auto',
|
|
||||||
paddingBottom: '40px',
|
|
||||||
},
|
|
||||||
messageContainer: {
|
|
||||||
marginTop: 25,
|
|
||||||
width: '100%',
|
|
||||||
},
|
|
||||||
sourceSms: {
|
sourceSms: {
|
||||||
float: 'right',
|
float: 'right',
|
||||||
margin: 10,
|
margin: 10,
|
||||||
|
|||||||
Reference in new issue
Block a user