update design
This commit is contained in:
parent
02c40f31cd
commit
766cd02774
4 changed files with 18 additions and 8 deletions
|
|
@ -28,6 +28,7 @@ firebaseService.getUserDataFromId(currentUserId); track user) {
|
||||||
(inititalsEmitter)="inititalsEmitter($event)"
|
(inititalsEmitter)="inititalsEmitter($event)"
|
||||||
[currentUserId]="currentUserId"
|
[currentUserId]="currentUserId"
|
||||||
[newColor]="newColor"
|
[newColor]="newColor"
|
||||||
|
[currentColor]="user.color"
|
||||||
></app-contact-form>
|
></app-contact-form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -53,12 +53,12 @@ section {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
position: relative;
|
|
||||||
width: 30%;
|
width: 30%;
|
||||||
margin-bottom: 115px;
|
margin-bottom: 115px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.picker {
|
.picker {
|
||||||
|
position: relative;
|
||||||
input {
|
input {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
@ -75,12 +75,15 @@ section {
|
||||||
.initials {
|
.initials {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 30%;
|
top: 30%;
|
||||||
left: 35%;
|
left: 0;
|
||||||
width: fit-content;
|
right: 0;
|
||||||
|
width: 120px;
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
|
text-align: center;
|
||||||
font-size: 47px;
|
font-size: 47px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: var(--white);
|
color: var(--white);
|
||||||
|
padding-left: 4px;
|
||||||
text-shadow: 1px 1px 2px var(--black);
|
text-shadow: 1px 1px 2px var(--black);
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
@ -118,7 +121,6 @@ section {
|
||||||
|
|
||||||
.initials {
|
.initials {
|
||||||
font-size: 42px;
|
font-size: 42px;
|
||||||
left: 33%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
|
|
@ -162,7 +164,7 @@ section {
|
||||||
|
|
||||||
.initials {
|
.initials {
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
left: 28%;
|
width: 80px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@
|
||||||
: ('contactDialogForm.phone' | translate)
|
: ('contactDialogForm.phone' | translate)
|
||||||
}}"
|
}}"
|
||||||
[(ngModel)]="contactData.phone"
|
[(ngModel)]="contactData.phone"
|
||||||
pattern="[0-9]{7,10}"
|
pattern="[0-9]{7,15}"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ export class ContactFormComponent implements OnInit, OnChanges {
|
||||||
@Input() currentUserId: string = '';
|
@Input() currentUserId: string = '';
|
||||||
@Input() randomColor: string = '';
|
@Input() randomColor: string = '';
|
||||||
@Input() newColor: string = '';
|
@Input() newColor: string = '';
|
||||||
|
@Input() currentColor: string = '';
|
||||||
@Output() inititalsEmitter = new EventEmitter<string>();
|
@Output() inititalsEmitter = new EventEmitter<string>();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
|
@ -154,13 +155,19 @@ export class ContactFormComponent implements OnInit, OnChanges {
|
||||||
onSubmit(ngForm: NgForm) {
|
onSubmit(ngForm: NgForm) {
|
||||||
if (ngForm.submitted && ngForm.form.valid) {
|
if (ngForm.submitted && ngForm.form.valid) {
|
||||||
if (this.currentUserId) {
|
if (this.currentUserId) {
|
||||||
this.contactData.color = this.newColor;
|
console.log(this.newColor, this.currentColor);
|
||||||
|
|
||||||
|
this.newColor !== ''
|
||||||
|
? (this.contactData.color = this.newColor)
|
||||||
|
: (this.contactData.color = this.currentColor);
|
||||||
this.firebaseService.updateUserData(
|
this.firebaseService.updateUserData(
|
||||||
this.currentUserId,
|
this.currentUserId,
|
||||||
this.contactData
|
this.contactData
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
this.userData.color = this.newColor;
|
this.newColor !== ''
|
||||||
|
? (this.userData.color = this.newColor)
|
||||||
|
: (this.userData.color = this.randomColor);
|
||||||
const { id, ...taskWithoutIds } = this.userData;
|
const { id, ...taskWithoutIds } = this.userData;
|
||||||
this.firebaseService.addNewUser(taskWithoutIds);
|
this.firebaseService.addNewUser(taskWithoutIds);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue