Skip to content

Commit

Permalink
Fix cover size (#1001)
Browse files Browse the repository at this point in the history
* cover image style fix

* fix

* Update workshop-card.component.html

* Update child-card.component.scss

Co-authored-by: Dmytro Minochkin <dmytro.minochkin@gmail.com>
  • Loading branch information
litvinets and DmyMi authored Mar 21, 2022
1 parent 6504a91 commit 694eeeb
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
cursor: pointer;
}
.icon {
height: 68px;
width: 68px;
height: 100px;
}
.title {
text-align: center;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@import "src/app/shared/styles/cards.scss";

.card {
height: 410px;
}
.mat-icon {
color: #fff;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
<div [ngClass]="isHorizontalView ? 'horizontal-card': 'card'">
<div [ngClass]="isCreateApplicationView ? 'card-img card-img-full card-img-mobile': 'card-img card-img-full'"
fxLayout="row" fxLayoutAlign="center">
<img mat-card-image [src]="coverImageUrl" alt="{{workshop?.title}}">
<img mat-card-image [src]="coverImageUrl" alt="{{workshop?.title}}"
[ngClass]="{'card-img-mobile': workshop.coverImageId}">
</div>
<div [ngClass]="isMainPage && isHorizontalView ? 'wrap-for-details wrap-for-details-map': 'wrap-for-details'">
<mat-card-header>
<mat-card-title [matTooltip]="workshop?.title" showTooltipIfTruncated matTooltipClass="tooltip"
[matTooltipPosition]="below" class="card-title">{{workshop?.title}}</mat-card-title>
<img mat-card-image [src]="categoryIcons[workshop?.directionId]"
[ngClass]="isCreateApplicationView ? 'card-img-mobile': ''" >
<img mat-card-image [src]="categoryIcons[workshop?.directionId]"
[ngClass]="{'card-img-mobile':isCreateApplicationView}">
</mat-card-header>

<mat-card-content fxLayout="column" fxLayoutAlign="space-between">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@import "src/app/shared/styles/cards.scss";
.card-img-full{
width: 100%;
max-height: 185px;
}
.card-img-mobile{
width: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,13 @@ export class WorkshopCardComponent implements OnInit, OnDestroy {
favoriteWorkshops$: Observable<Favorite[]>;
@Select(RegistrationState.role)
role$: Observable<string>;
@Select(UserState.selectedWorkshop)
@Select(UserState.selectedWorkshop)
workshop$: Observable<WorkshopCard>;
role: string;
destroy$: Subject<boolean> = new Subject<boolean>();

authServer: string = environment.serverUrl;
imgUrl = `/api/v1/PublicImage/`;
coverImageId: string = '';
coverImageUrl: string = '';

constructor(
Expand Down
13 changes: 6 additions & 7 deletions src/app/shared/styles/cards.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.card {
width: 300px;
height: 410px;
min-height: 410px;
display: flex;
justify-content: flex-start;
flex-direction: column;
Expand All @@ -15,10 +15,6 @@
line-height: 20px;
}

&-image {
max-width: 50%;
}

&_category {
width: 30px;
height: 30px;
Expand Down Expand Up @@ -197,9 +193,12 @@
margin: 0!important;
}
.mat-card-image {
width: 100%;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 60%;
margin: 0;
height: 187px;
object-fit: cover;
object-position: top;
}
Expand Down

0 comments on commit 694eeeb

Please sign in to comment.