Skip to content

Commit eebe92e

Browse files
committed
change design of project chat section, fix websockets
1 parent af3240f commit eebe92e

6 files changed

Lines changed: 92 additions & 55 deletions

File tree

projects/social_platform/src/app/office/features/message-input/message-input.component.html

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@
55
<ul class="message-input__action action files-list">
66
@for (file of attachFiles; let index = $index; track index) {
77
<li class="files-list__item file" [class.file--loading]="file.loading">
8-
<i class="file__type" appIcon [icon]="'file_' + (file.type | fileType)" appSquare="24"></i>
9-
<h3 class="file__name">{{ file.name }}</h3>
10-
<div class="file__size">{{ +file.size | formatedFileSize }}</div>
11-
<!--Use hardcoded svg here, because svg sprites
12-
aren't capable of animation-->
8+
<i class="file__icon file__icon--file" appIcon icon="file" appSquare="8"></i>
9+
<div class="file__info">
10+
<h3 class="file__name text-body-10">{{ file.name.split(".")[0] }}</h3>
11+
@if (file.type) {
12+
<div class="file__meta text-body-6">
13+
{{ file.type.includes("/") ? (file.type | fileType) : (file.type | uppercase) }} •
14+
{{ +file.size | formatedFileSize }}
15+
</div>
16+
}
17+
</div>
1318
@if (file.loading) {
1419
<svg
1520
class="file__loading"
@@ -39,10 +44,10 @@ <h3 class="file__name">{{ file.name }}</h3>
3944
</svg>
4045
} @else {
4146
<i
42-
class="file__basket"
47+
class="file__icon file__icon--basket"
4348
appIcon
4449
icon="basket"
45-
appSquare="12"
50+
appSquare="8"
4651
(click)="onDeleteFile(index)"
4752
></i>
4853
}

projects/social_platform/src/app/office/features/message-input/message-input.component.scss

Lines changed: 52 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
$button-size: 40px;
77

88
.message-input {
9+
position: relative;
910
padding: 12px;
1011
border: 0.5px solid var(--medium-grey-for-outline);
1112
border-radius: 8px;
@@ -100,23 +101,33 @@ $button-size: 40px;
100101
}
101102

102103
.files-list {
104+
position: absolute;
105+
bottom: 77%;
106+
left: 15px;
103107
display: flex;
104-
padding: 0 0 12px;
105108
list-style-type: none;
106109

107110
&__item {
111+
display: flex;
112+
gap: 12px;
113+
align-items: center;
114+
justify-content: space-between;
115+
padding: 24px;
116+
background-color: var(--light-white);
117+
border-color: var(--medium-grey-for-outline);
118+
border-style: solid;
119+
border-width: 0.5px 0.5px 0px 0.5px;
120+
border-top-left-radius: 10px;
121+
border-top-right-radius: 10px;
122+
box-shadow: 4px -4px 4px rgb(51 51 51 / 20%);
123+
108124
&:not(:last-child) {
109125
margin-right: 18px;
110126
}
111127
}
112128
}
113129

114130
.file {
115-
min-width: 140px;
116-
padding: 10px;
117-
border: 1px solid var(--medium-grey-for-outline);
118-
border-radius: 20px;
119-
120131
&--loading {
121132
.file__name {
122133
color: var(--dark-grey);
@@ -128,37 +139,53 @@ $button-size: 40px;
128139
}
129140
}
130141

131-
&__type {
132-
display: block;
133-
margin-bottom: 12px;
142+
&__info {
143+
display: flex;
144+
flex-direction: column;
145+
}
146+
147+
&__icon {
148+
display: flex;
149+
align-items: center;
150+
align-self: center;
151+
justify-content: center;
152+
width: 20px;
153+
height: 20px;
154+
margin-right: 6px;
155+
cursor: pointer;
156+
border-radius: var(--rounded-xl);
157+
transition: color 0.2s;
158+
159+
&--file {
160+
color: var(--accent);
161+
border: 0.5px solid var(--accent);
162+
163+
&:hover {
164+
color: var(--accent-dark);
165+
}
166+
}
167+
168+
&--basket {
169+
color: var(--red);
170+
border: 0.5px solid var(--red);
171+
172+
&:hover {
173+
color: var(--red-dark);
174+
}
175+
}
134176
}
135177

136178
&__name {
137179
color: var(--black);
138-
139-
@include typography.body-14;
140180
}
141181

142-
&__size {
143-
margin-bottom: 12px;
182+
&__meta {
144183
color: var(--dark-grey);
145-
146-
@include typography.body-12;
147184
}
148185

149186
&__loading {
150187
color: var(--accent);
151188
}
152-
153-
&__basket {
154-
color: var(--red);
155-
cursor: pointer;
156-
transition: color 0.2s;
157-
158-
&:hover {
159-
color: var(--red-dark);
160-
}
161-
}
162189
}
163190

164191
.drop-modal {

projects/social_platform/src/app/office/features/message-input/message-input.component.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { AutosizeModule } from "ngx-autosize";
1818
import { NgxMaskModule } from "ngx-mask";
1919
import { IconComponent } from "@ui/components";
2020
import { FormatedFileSizePipe } from "@core/pipes/formatted-file-size.pipe";
21+
import { UpperCasePipe } from "@angular/common";
2122

2223
/**
2324
* Компонент ввода сообщений для чата
@@ -43,7 +44,14 @@ import { FormatedFileSizePipe } from "@core/pipes/formatted-file-size.pipe";
4344
},
4445
],
4546
standalone: true,
46-
imports: [IconComponent, NgxMaskModule, AutosizeModule, FileTypePipe, FormatedFileSizePipe],
47+
imports: [
48+
IconComponent,
49+
NgxMaskModule,
50+
AutosizeModule,
51+
FileTypePipe,
52+
FormatedFileSizePipe,
53+
UpperCasePipe,
54+
],
4755
})
4856
export class MessageInputComponent implements OnInit, OnDestroy, ControlValueAccessor {
4957
/**

projects/social_platform/src/app/office/projects/detail/chat/chat.component.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ $input-height: 66px + 18px;
4545
.main {
4646
display: flex;
4747
flex-direction: column;
48-
background-color: var(--light-white);
4948

5049
&__chat {
5150
display: none;
@@ -57,6 +56,8 @@ $input-height: 66px + 18px;
5756

5857
@include responsive.apply-desktop {
5958
display: block;
59+
background-color: var(--light-white);
60+
border-radius: 15px;
6061
}
6162
}
6263
}

projects/social_platform/src/app/ui/components/chat-message/chat-message.component.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@
1010
<div class="message__inner">
1111
<app-avatar
1212
class="message__avatar"
13-
[size]="40"
13+
[size]="30"
1414
[isOnline]="chatMessage.author.isOnline"
1515
[onlineBadgeBorder]="2"
1616
[onlineBadgeSize]="10"
1717
[url]="chatMessage.author.avatar"
1818
></app-avatar>
1919
<div class="message__info">
2020
<div class="message__top">
21-
<div class="message__name text-bold-body-16">
21+
<div class="message__name text-body-10">
2222
{{ chatMessage.author.firstName }} {{ chatMessage.author.lastName }}
2323
</div>
24-
<div class="message__time text-body-14">
24+
<div class="message__time text-body-10">
2525
{{ chatMessage.createdAt | dayjs: "format":"HH:mm" }}
2626
</div>
2727
</div>
2828
@if (chatMessage.replyTo) {
2929
<div class="message__reply reply">
30-
<div class="reply__name text-bold-body-16">
30+
<div class="reply__name text-body-10">
3131
{{ chatMessage.replyTo.author.firstName }} {{ chatMessage.replyTo.author.lastName }}
3232
</div>
33-
<p class="reply__message text-body-1">
33+
<p class="reply__message text-body-10">
3434
{{ chatMessage.replyTo.text }}
3535
</p>
3636
</div>
@@ -47,15 +47,15 @@
4747
</li>
4848
}
4949
</ul>
50-
<div class="message__content text-body-14">{{ chatMessage.text }}</div>
50+
<div class="message__content text-body-10">{{ chatMessage.text }}</div>
5151
</div>
5252
</div>
5353
<div
5454
class="message__menu-dots"
5555
(click)="onOpenContextmenu($event)"
5656
(clickOutside)="onCloseContextmenu()"
5757
>
58-
<i appIcon icon="dots" appWidth="4" appHeight="16" appViewBox="0 0 4 16"></i>
58+
<i appIcon icon="dots" appWidth="4" appHeight="10" appViewBox="0 0 4 10"></i>
5959
</div>
6060
</div>
6161
@if (authService.profile | async; as profile) {
@@ -65,13 +65,13 @@
6565
[style.opacity]="isOpen ? 1 : 0"
6666
[style.pointer-events]="isOpen ? 'auto' : 'none'"
6767
>
68-
<li class="contextmenu__item text-body-14" (click)="onCopyContent($event)">Скопировать</li>
69-
<li class="contextmenu__item text-body-14" (click)="onReply($event)">Ответить</li>
68+
<li class="contextmenu__item text-body-10" (click)="onCopyContent($event)">скопировать</li>
69+
<li class="contextmenu__item text-body-10" (click)="onReply($event)">ответить</li>
7070
@if (profile.id === chatMessage.author.id) {
7171
<ng-container>
72-
<li class="contextmenu__item text-body-14" (click)="onEdit($event)">Редактировать</li>
73-
<li class="contextmenu__item contextmenu__item--red text-body-14" (click)="onDelete($event)">
74-
Удалить
72+
<li class="contextmenu__item text-body-10" (click)="onEdit($event)">редактировать</li>
73+
<li class="contextmenu__item contextmenu__item--red text-body-10" (click)="onDelete($event)">
74+
удалить
7575
</li>
7676
</ng-container>
7777
}

projects/social_platform/src/app/ui/components/chat-message/chat-message.component.scss

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
display: flex;
99
align-items: center;
1010
max-width: 100%;
11-
padding: 10px 28px 10px 20px;
11+
padding: 10px;
1212

1313
&--unread {
1414
background-color: #f7f3ff;
@@ -37,6 +37,7 @@
3737
&__top {
3838
display: flex;
3939
align-items: center;
40+
justify-content: space-between;
4041
margin-bottom: 5px;
4142
}
4243

@@ -57,14 +58,14 @@
5758
}
5859

5960
&__content {
60-
color: var(--dark-grey);
61+
color: var(--black);
6162
word-break: break-word;
6263
white-space: pre-wrap;
6364
}
6465

6566
&__name {
6667
margin-right: 15px;
67-
color: var(--black);
68+
color: var(--accent);
6869
}
6970

7071
&__menu-dots {
@@ -78,13 +79,8 @@
7879
margin-left: auto;
7980
color: var(--dark-grey);
8081
cursor: pointer;
81-
background-color: var(--white);
8282
border-radius: var(--rounded-md);
8383
transition: background-color 0.2s;
84-
85-
&:hover {
86-
background-color: var(--light-gray);
87-
}
8884
}
8985

9086
&__contextmenu {
@@ -98,7 +94,7 @@
9894
}
9995

10096
.contextmenu {
101-
padding: 8px;
97+
padding: 10px;
10298
background-color: var(--white);
10399
border-radius: var(--rounded-lg);
104100
box-shadow: 5px 5px 25px rgb(159 159 159 / 15%);

0 commit comments

Comments
 (0)