Better and Responsive Picture Selector
This commit is contained in:
@@ -2,13 +2,7 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-container .row {
|
.profile-options-container {
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.profile-container {
|
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
display: flex !important;
|
display: flex !important;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -18,6 +12,14 @@
|
|||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.profile-options-row {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
.separator-line {
|
.separator-line {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
@@ -33,7 +35,7 @@
|
|||||||
border-radius: 50px;
|
border-radius: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-container button {
|
.profile-options-container button {
|
||||||
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
@@ -56,7 +58,7 @@
|
|||||||
|
|
||||||
@media (min-width:767px) {
|
@media (min-width:767px) {
|
||||||
|
|
||||||
.profile-container {
|
.profile-options-container {
|
||||||
all: unset;
|
all: unset;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
width: 600px;
|
width: 600px;
|
||||||
@@ -65,7 +67,7 @@
|
|||||||
height: 200px;
|
height: 200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-container .row {
|
.profile-options-container .row {
|
||||||
all: unset;
|
all: unset;
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 200px;
|
height: 200px;
|
||||||
|
|||||||
@@ -9,11 +9,11 @@
|
|||||||
[@showErrorMessage]="showErrorMessage()">
|
[@showErrorMessage]="showErrorMessage()">
|
||||||
</app-error-box>
|
</app-error-box>
|
||||||
|
|
||||||
<div class="container profile-container"
|
<div class="container profile-options-container"
|
||||||
[@hideAuthContainer]="hideErrorMessage()"
|
[@hideAuthContainer]="hideErrorMessage()"
|
||||||
(@hideAuthContainer.done)="hideAuthContainer($event)">
|
(@hideAuthContainer.done)="hideAuthContainer($event)">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row profile-options-row">
|
||||||
|
|
||||||
<div class="btn-container">
|
<div class="btn-container">
|
||||||
<app-profile-picture-picker
|
<app-profile-picture-picker
|
||||||
|
|||||||
@@ -8,12 +8,12 @@
|
|||||||
(change)="handleFileInput($event)">
|
(change)="handleFileInput($event)">
|
||||||
<label class="custom-file-label"
|
<label class="custom-file-label"
|
||||||
for="inputProfilePicture">
|
for="inputProfilePicture">
|
||||||
Profile Picture
|
{{isProfilePictureSelected ? getFileName() : 'Profile Picture'}}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<button class="btn btn-outline-secondary"
|
<button class="btn btn-outline-secondary"
|
||||||
[disabled]="isProfilePictureSelected"
|
[disabled]="!isProfilePictureSelected"
|
||||||
(click)="uploadProfilePicture()">Upload</button>
|
(click)="uploadProfilePicture()">Upload</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -28,8 +28,12 @@ export class ProfilePicturePickerComponent {
|
|||||||
this.imageSent.emit(true);
|
this.imageSent.emit(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getFileName(): string {
|
||||||
|
return this.profilePicture.name;
|
||||||
|
}
|
||||||
|
|
||||||
get isProfilePictureSelected(): boolean {
|
get isProfilePictureSelected(): boolean {
|
||||||
return !this.profilePicture;
|
return !!this.profilePicture;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user