mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 06:28:51 +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,
|
||||
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 { 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 ImageIcon from '@material-ui/icons/Image';
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
@@ -10,8 +10,13 @@ interface IProps {
|
||||
messageGroupId: string | undefined;
|
||||
}
|
||||
|
||||
const useStyles = makeStyles({
|
||||
root: { position: 'absolute', bottom: 0, width: '100%' },
|
||||
});
|
||||
|
||||
const MessageInput = ({ messageGroupId, onAddImageClick }: IProps) => {
|
||||
const { t } = useTranslation();
|
||||
const classes = useStyles();
|
||||
const [message, setMessage] = useState('');
|
||||
|
||||
const handleSubmit = (event: FormEvent) => {
|
||||
@@ -29,7 +34,7 @@ const MessageInput = ({ messageGroupId, onAddImageClick }: IProps) => {
|
||||
if (!messageGroupId) return null;
|
||||
|
||||
return (
|
||||
<Paper variant='outlined' style={{ position: 'absolute', bottom: 0, width: '100%' }}>
|
||||
<Paper variant='outlined' className={classes.root}>
|
||||
<form onSubmit={handleSubmit}>
|
||||
<Box display='flex'>
|
||||
<Box pl={1} flexGrow={1}>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 MessageInput from '../form/MessageInput';
|
||||
@@ -32,9 +32,16 @@ const Conversation = ({ activeMessageGroup, messages }: IProps) => {
|
||||
isOpen={imageModalOpen}
|
||||
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) => (
|
||||
<div key={message.id} className={classes.messageContainer}>
|
||||
<div key={message.id}>
|
||||
<Paper
|
||||
className={message.isMine ? classes.sourceSms : classes.sms}
|
||||
variant='outlined'
|
||||
@@ -56,7 +63,7 @@ const Conversation = ({ activeMessageGroup, messages }: IProps) => {
|
||||
</Paper>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</Box>
|
||||
<MessageInput
|
||||
messageGroupId={activeMessageGroup.groupId}
|
||||
onAddImageClick={() => setImageModalOpen(true)}
|
||||
|
||||
@@ -15,6 +15,9 @@ const useStyles = makeStyles((theme) => ({
|
||||
flexFlow: 'row nowrap',
|
||||
padding: '3px 0px',
|
||||
},
|
||||
overflowAutoY: {
|
||||
overflowY: 'auto',
|
||||
},
|
||||
groupdisplay: {
|
||||
width: '300px',
|
||||
paddingTop: '8px',
|
||||
@@ -28,15 +31,6 @@ const useStyles = makeStyles((theme) => ({
|
||||
paddingTop: '8px',
|
||||
fontSize: '20px',
|
||||
},
|
||||
messageList: {
|
||||
height: '90%',
|
||||
overflowY: 'auto',
|
||||
paddingBottom: '40px',
|
||||
},
|
||||
messageContainer: {
|
||||
marginTop: 25,
|
||||
width: '100%',
|
||||
},
|
||||
sourceSms: {
|
||||
float: 'right',
|
||||
margin: 10,
|
||||
|
||||
Reference in new issue
Block a user