mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 06:28:51 +00:00
Bugfix / Fix message bubble, notifications slideup phone and overflow and conversation scrolling (#144)
* Fix overflow on message bubbles * Fix messages scrolling * fix(phone/messages): Fix notification slide when in messages app
This commit is contained in:
1 parent
f4834b78c8
commit
0c602f1767
7 files changed
+84
-85
No files matched your search
+2
-1
@@ -53,11 +53,12 @@ function Phone() {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Slide direction="up" in={visibility}>
|
||||
<Slide direction="up" timeout={{ enter: 500, exit: 500 }} in={visibility}>
|
||||
<div className="PhoneWrapper">
|
||||
<div
|
||||
className="Phone"
|
||||
style={{
|
||||
position: 'fixed',
|
||||
transformOrigin: 'right bottom',
|
||||
transform: `scale(${settings.zoom.value}`,
|
||||
bottom,
|
||||
|
||||
@@ -26,24 +26,22 @@ export const MessagesApp = () => {
|
||||
<AppTitle app={messages} />
|
||||
<AppContent>
|
||||
<Switch>
|
||||
<Route path="/messages/conversations/:groupId" component={MessageModal} />
|
||||
<Route
|
||||
exact
|
||||
path="/messages"
|
||||
render={() => (
|
||||
<>
|
||||
<MessagesList />
|
||||
<NewMessageGroupButton onClick={() => history.push('/messages/new')} />
|
||||
</>
|
||||
)}
|
||||
/>
|
||||
<Route path="/messages/conversations/:groupId">
|
||||
<div>
|
||||
<MessageModal />
|
||||
</div>
|
||||
</Route>
|
||||
<Route exact path="/messages">
|
||||
<>
|
||||
<MessagesList />
|
||||
<NewMessageGroupButton onClick={() => history.push('/messages/new')} />
|
||||
</>
|
||||
</Route>
|
||||
</Switch>
|
||||
<Switch>
|
||||
<Route
|
||||
exact
|
||||
path={['/messages/new/:phoneNumber', '/messages/new']}
|
||||
render={() => <MessageGroupModal />}
|
||||
/>
|
||||
<Route exact path={['/messages/new/:phoneNumber', '/messages/new']}>
|
||||
<MessageGroupModal />
|
||||
</Route>
|
||||
</Switch>
|
||||
</AppContent>
|
||||
</AppWrapper>
|
||||
@@ -52,60 +50,6 @@ export const MessagesApp = () => {
|
||||
};
|
||||
|
||||
InjectDebugData([
|
||||
{
|
||||
app: 'MESSAGES',
|
||||
method: 'phone:fetchMessagesSuccess',
|
||||
data: [
|
||||
{
|
||||
id: 1,
|
||||
message: 'sup!',
|
||||
user_identifier: '1234',
|
||||
phone_number: '444-4444',
|
||||
display: 'kidz',
|
||||
avatar: null,
|
||||
groupId: '2',
|
||||
isRead: true,
|
||||
isMine: false,
|
||||
updatedAt: Date.now(),
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
message: 'sup!',
|
||||
user_identifier: '1234',
|
||||
phone_number: '444-4444',
|
||||
display: 'kidz',
|
||||
avatar: null,
|
||||
groupId: '2',
|
||||
isRead: true,
|
||||
isMine: false,
|
||||
updatedAt: Date.now(),
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
message: 'sup!',
|
||||
user_identifier: '123',
|
||||
phone_number: '444-4444',
|
||||
display: 'kidz',
|
||||
avatar: null,
|
||||
groupId: '2',
|
||||
isRead: true,
|
||||
isMine: false,
|
||||
updatedAt: Date.now(),
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
message: 'what are you doing!?',
|
||||
user_identifier: '12345',
|
||||
phone_number: '444-5555',
|
||||
display: '444-5555',
|
||||
avatar: null,
|
||||
groupId: '2',
|
||||
isRead: true,
|
||||
isMine: false,
|
||||
updatedAt: Date.now(),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
app: 'MESSAGES',
|
||||
method: 'phone:fetchMessageGroupsSuccess',
|
||||
@@ -136,6 +80,48 @@ InjectDebugData([
|
||||
|
||||
InjectDebugData(
|
||||
[
|
||||
{
|
||||
app: 'MESSAGES',
|
||||
method: 'phone:fetchMessagesSuccess',
|
||||
data: [
|
||||
{
|
||||
id: 1,
|
||||
message: 'sup!',
|
||||
user_identifier: '1234',
|
||||
phone_number: '444-4444',
|
||||
display: 'kidz',
|
||||
avatar: null,
|
||||
groupId: '2',
|
||||
isRead: true,
|
||||
isMine: false,
|
||||
updatedAt: Date.now(),
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
message: 'sup!',
|
||||
user_identifier: '1234',
|
||||
phone_number: '444-4444',
|
||||
display: 'kidz',
|
||||
avatar: null,
|
||||
groupId: '2',
|
||||
isRead: true,
|
||||
isMine: true,
|
||||
updatedAt: Date.now(),
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
message: 'sup!',
|
||||
user_identifier: '123',
|
||||
phone_number: '444-4444',
|
||||
display: 'kidz',
|
||||
avatar: null,
|
||||
groupId: '2',
|
||||
isRead: true,
|
||||
isMine: false,
|
||||
updatedAt: Date.now(),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
app: 'MESSAGES',
|
||||
method: 'createMessagesBroadcast',
|
||||
|
||||
@@ -23,22 +23,14 @@ const Conversation = ({ activeMessageGroup, messages, onClickDisplay }: IProps)
|
||||
const referalImage = query?.image || null;
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={classes.conversationContainer}>
|
||||
<MessageImageModal
|
||||
image={referalImage}
|
||||
onClose={() => setImageModalOpen(false)}
|
||||
isOpen={imageModalOpen}
|
||||
messageGroupId={activeMessageGroup.groupId}
|
||||
/>
|
||||
<Box
|
||||
id={CONVERSATION_ELEMENT_ID}
|
||||
height="85%"
|
||||
display="flex"
|
||||
flexDirection="column"
|
||||
justifyContent="flex-end"
|
||||
pb={4}
|
||||
className={classes.overflowAutoY}
|
||||
>
|
||||
<Box id={CONVERSATION_ELEMENT_ID} height="85%" py={6} className={classes.overflowAutoY}>
|
||||
{messages.map((message) => (
|
||||
<MessageBubble
|
||||
onClickDisplay={onClickDisplay}
|
||||
@@ -54,7 +46,7 @@ const Conversation = ({ activeMessageGroup, messages, onClickDisplay }: IProps)
|
||||
messageGroupId={activeMessageGroup.groupId}
|
||||
onAddImageClick={() => setImageModalOpen(true)}
|
||||
/>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -35,6 +35,9 @@ const useStyles = makeStyles((theme) => ({
|
||||
borderRadius: '15px',
|
||||
textOverflow: 'ellipsis',
|
||||
},
|
||||
message: {
|
||||
wordBreak: 'break-all',
|
||||
},
|
||||
}));
|
||||
|
||||
const isImage = (url) => {
|
||||
@@ -54,7 +57,7 @@ export const MessageBubble = ({
|
||||
return (
|
||||
<div>
|
||||
<Paper className={message.isMine ? classes.mySms : classes.sms} variant="outlined">
|
||||
<Box>
|
||||
<Box className={classes.message}>
|
||||
{isImage(message.message) ? (
|
||||
<img src={message.message} className={classes.imageMessage} alt="multimedia" />
|
||||
) : (
|
||||
|
||||
@@ -130,7 +130,7 @@ export const MessageModal = () => {
|
||||
</Modal>
|
||||
<Slide direction="left" in={!!activeMessageGroup}>
|
||||
<Paper className={classes.modalRoot}>
|
||||
<Paper>
|
||||
<Paper className={classes.conversationHeader}>
|
||||
<Box display="flex" justifyContent="space-between">
|
||||
<Button onClick={closeModal}>
|
||||
<ArrowBackIcon fontSize="large" />
|
||||
|
||||
@@ -11,8 +11,25 @@ const useStyles = makeStyles({
|
||||
modalHide: {
|
||||
display: 'none',
|
||||
},
|
||||
conversationHeader: {
|
||||
zIndex: 10,
|
||||
},
|
||||
conversationContainer: {
|
||||
zIndex: -1,
|
||||
display: 'flex',
|
||||
flexFlow: 'row wrap',
|
||||
flexDirection: 'column',
|
||||
position: 'absolute',
|
||||
top: '0',
|
||||
left: '0',
|
||||
right: '0',
|
||||
bottom: '0',
|
||||
},
|
||||
overflowAutoY: {
|
||||
flex: 6,
|
||||
overflowY: 'auto',
|
||||
overflowX: 'hidden',
|
||||
justifyContent: 'end',
|
||||
},
|
||||
groupdisplay: {
|
||||
width: '300px',
|
||||
|
||||
@@ -40,7 +40,7 @@ export const usePhoneVisibility = () => {
|
||||
if (!visibility) {
|
||||
return `${-728 * zoom.value}px`;
|
||||
}
|
||||
return 0;
|
||||
return '0px';
|
||||
}, [visibility, zoom]);
|
||||
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user