clean code
This commit is contained in:
parent
b190387fc3
commit
d3ec4ee5a2
7 changed files with 37 additions and 14 deletions
|
|
@ -44,7 +44,8 @@
|
||||||
[imgSize]="'16px'"
|
[imgSize]="'16px'"
|
||||||
[btnSize]="'24px'"
|
[btnSize]="'24px'"
|
||||||
[btnBgHoverColor]="'#edeefe'"
|
[btnBgHoverColor]="'#edeefe'"
|
||||||
(click)="fileInput.click()"
|
[disable]="downloadFilesService.uploadFiles.length >= 1"
|
||||||
|
(click)="handleFileInputClick()"
|
||||||
></app-small-btn>
|
></app-small-btn>
|
||||||
<img class="verticalLine" src="./assets/img/verticalLine.svg" />
|
<img class="verticalLine" src="./assets/img/verticalLine.svg" />
|
||||||
<app-small-btn
|
<app-small-btn
|
||||||
|
|
@ -63,20 +64,15 @@
|
||||||
(click)="targetChatUser($event)"
|
(click)="targetChatUser($event)"
|
||||||
></app-small-btn>
|
></app-small-btn>
|
||||||
<!-- Warning message -->
|
<!-- Warning message -->
|
||||||
@if (downloadFilesService.uploadFiles.length >= 1 && !fileDataError &&
|
@if(fileDataError){
|
||||||
!fileSizeError){
|
|
||||||
<p class="warningMessage">
|
|
||||||
{{ "channel-msg-box.text0" | translate }}
|
|
||||||
</p>
|
|
||||||
} @if(fileDataError){
|
|
||||||
<p class="warningMessage">
|
<p class="warningMessage">
|
||||||
{{ "channel-msg-box.text1" | translate }}
|
{{ "channel-msg-box.text1" | translate }}
|
||||||
</p>
|
</p>
|
||||||
} @if(fileSizeError){
|
} @else { @if(fileSizeError){
|
||||||
<p class="warningMessage">
|
<p class="warningMessage">
|
||||||
{{ "channel-msg-box.text2" | translate }}
|
{{ "channel-msg-box.text2" | translate }}
|
||||||
</p>
|
</p>
|
||||||
}
|
} }
|
||||||
<div class="filteredElementWindow">
|
<div class="filteredElementWindow">
|
||||||
@if (toggleBoolean.selectUserInMsgBox) {
|
@if (toggleBoolean.selectUserInMsgBox) {
|
||||||
<div class="positionOfAllUsersInBox">
|
<div class="positionOfAllUsersInBox">
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ export class ChatMsgBoxComponent {
|
||||||
@Input() viewWidth: number = 0;
|
@Input() viewWidth: number = 0;
|
||||||
@Output() newMsgEmitter: EventEmitter<boolean> = new EventEmitter<boolean>();
|
@Output() newMsgEmitter: EventEmitter<boolean> = new EventEmitter<boolean>();
|
||||||
@ViewChild('textarea') textAreaRef!: ElementRef;
|
@ViewChild('textarea') textAreaRef!: ElementRef;
|
||||||
|
@ViewChild('fileInput') fileInput!: ElementRef;
|
||||||
|
|
||||||
hasFile: boolean = false;
|
hasFile: boolean = false;
|
||||||
fileDataError: boolean = false;
|
fileDataError: boolean = false;
|
||||||
|
|
@ -98,6 +99,12 @@ export class ChatMsgBoxComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleFileInputClick() {
|
||||||
|
if (this.downloadFilesService.uploadFiles.length < 1) {
|
||||||
|
this.fileInput.nativeElement.click();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles file input change event.
|
* Handles file input change event.
|
||||||
* @param event The file change event.
|
* @param event The file change event.
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<div
|
<button
|
||||||
class="smallBtn"
|
class="smallBtn"
|
||||||
[ngStyle]="{
|
[ngStyle]="{
|
||||||
width: btnSize,
|
width: btnSize,
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
'background-color': btnBgColor,
|
'background-color': btnBgColor,
|
||||||
'--btnBgHoverColor': btnBgHoverColor
|
'--btnBgHoverColor': btnBgHoverColor
|
||||||
}"
|
}"
|
||||||
|
[disabled]="disable"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
[ngStyle]="{
|
[ngStyle]="{
|
||||||
|
|
@ -13,7 +14,7 @@
|
||||||
height: imgSize,
|
height: imgSize,
|
||||||
'--filter': imgFilter
|
'--filter': imgFilter
|
||||||
}"
|
}"
|
||||||
src="./assets/img/{{ imgSrc }}"
|
[src]="'assets/img/' + imgSrc"
|
||||||
alt=""
|
alt=""
|
||||||
/>
|
/>
|
||||||
</div>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,17 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
border: 0px;
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
|
background-color: transparent;
|
||||||
width: 0;
|
width: 0;
|
||||||
height: 0;
|
height: 0;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: 0.125s ease-in-out;
|
transition: 0.125s ease-in-out;
|
||||||
|
img {
|
||||||
|
filter: brightness(0) saturate(100%) invert(0%) sepia(5%) saturate(7481%)
|
||||||
|
hue-rotate(228deg) brightness(98%) contrast(106%);
|
||||||
|
}
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: var(--btnBgHoverColor);
|
background-color: var(--btnBgHoverColor);
|
||||||
img {
|
img {
|
||||||
|
|
@ -15,3 +21,17 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.smallBtn[disabled] {
|
||||||
|
cursor: auto;
|
||||||
|
img {
|
||||||
|
filter: brightness(0) saturate(100%) invert(40%) sepia(0%) saturate(29%)
|
||||||
|
hue-rotate(173deg) brightness(99%) contrast(91%);
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
background-color: transparent;
|
||||||
|
img {
|
||||||
|
scale: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,4 +16,5 @@ export class SmallBtnComponent {
|
||||||
@Input() btnSize: string = '28px';
|
@Input() btnSize: string = '28px';
|
||||||
@Input() btnBgColor: string = '';
|
@Input() btnBgColor: string = '';
|
||||||
@Input() btnBgHoverColor: string = '#edeefe';
|
@Input() btnBgHoverColor: string = '#edeefe';
|
||||||
|
@Input() disable: boolean = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,6 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
"channel-msg-box": {
|
"channel-msg-box": {
|
||||||
"text0": "Maximal eine Datei pro Nachricht",
|
|
||||||
"text1": "Dieses Dateiformat ist ungültig",
|
"text1": "Dieses Dateiformat ist ungültig",
|
||||||
"text2": "Dateigröße max. 1 MB",
|
"text2": "Dateigröße max. 1 MB",
|
||||||
"placeholder": "Geben Sie Ihre Nachricht ein"
|
"placeholder": "Geben Sie Ihre Nachricht ein"
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,6 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
"channel-msg-box": {
|
"channel-msg-box": {
|
||||||
"text0": "Maximum one file per message",
|
|
||||||
"text1": "This file format is invalid",
|
"text1": "This file format is invalid",
|
||||||
"text2": "File size max. 1 MB",
|
"text2": "File size max. 1 MB",
|
||||||
"placeholder": "Enter your message"
|
"placeholder": "Enter your message"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue