Skip to content

Commit bb9d07f

Browse files
improve the css office-navigation-page
improve the broder logic improve the error
1 parent 28c8f7b commit bb9d07f

File tree

4 files changed

+133
-23
lines changed

4 files changed

+133
-23
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
:host {
2+
display: block;
3+
}
4+
5+
.container {
6+
width: 100%;
7+
}
8+
9+
.layout-row-wrap.responsive-column {
10+
display: flex;
11+
flex-wrap: wrap;
12+
align-items: flex-start;
13+
}
14+
15+
.flex-48 {
16+
flex: 1 1 48%;
17+
min-width: 320px;
18+
}
19+
20+
mat-card {
21+
padding: 16px;
22+
border-radius: 8px;
23+
overflow: hidden;
24+
}
25+
26+
mat-card-content {
27+
display: grid;
28+
grid-template-columns: 100%;
29+
}
30+
31+
mat-form-field {
32+
width: 100%;
33+
}
34+
35+
mat-label {
36+
letter-spacing: 0.2px;
37+
}
38+
39+
@media (768px <= width) {
40+
mat-card-content {
41+
grid-template-columns: 50% 50%;
42+
}
43+
}
44+
45+
@media (1200px <= width) {
46+
.flex-48 {
47+
flex-basis: 48%;
48+
}
49+
50+
mat-card-content {
51+
grid-template-columns: 50% 50%;
52+
gap: 16px;
53+
}
54+
}

src/app/navigation/office-navigation/office-navigation.component.html

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<mat-card-header class="layout-row gap-5percent header">
1+
<mat-card-header class="layout-row header">
22
<fa-icon class="main-icon" icon="building" size="3x"></fa-icon>
33
<mat-card-title-group>
44
<div class="mat-typography">
@@ -7,19 +7,20 @@ <h2>
77
{{ officeData.name }}
88
</h2>
99
</mat-card-title>
10-
<mat-card-subtitle>
11-
<p *ngIf="officeData.externalId">
12-
{{ 'labels.inputs.External Id' | translate }}:<mifosx-external-identifier
13-
externalId="{{ officeData.externalId }}"
14-
></mifosx-external-identifier>
15-
</p>
16-
</mat-card-subtitle>
1710
</div>
1811
</mat-card-title-group>
1912
</mat-card-header>
2013

2114
<mat-card-content>
2215
<div class="layout-row-wrap">
16+
<div class="flex-50 mat-body-strong" *ngIf="officeData.externalId">
17+
{{ 'labels.inputs.External Id' | translate }}
18+
</div>
19+
20+
<div class="flex-50" *ngIf="officeData.externalId">
21+
<mifosx-external-identifier externalId="{{ officeData.externalId }}"></mifosx-external-identifier>
22+
</div>
23+
2324
<div class="flex-50 mat-body-strong">
2425
{{ 'labels.inputs.Opened On' | translate }}
2526
</div>
Lines changed: 69 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,76 @@
1-
h2 {
2-
font-weight: 500;
1+
:host {
2+
--border-color: #ddd;
33
}
44

5-
.content {
6-
div {
7-
margin: 1rem 0;
5+
.header {
6+
padding: 1.5rem 1.5rem 1rem;
7+
align-items: center;
8+
gap: 1rem;
9+
10+
.main-icon {
11+
margin: 0;
12+
}
13+
14+
mat-card-title-group {
15+
display: flex;
16+
flex-direction: column;
17+
gap: 0.5rem;
18+
flex: 1;
19+
}
20+
21+
mat-card-title h2 {
22+
font-weight: 500;
23+
font-size: 1.5rem;
24+
margin: 0;
25+
line-height: 1.4;
26+
}
27+
}
28+
29+
mat-card-content {
30+
padding: 1.5rem;
31+
32+
.layout-row-wrap {
33+
display: grid;
34+
grid-template-columns: 50% 50%;
35+
36+
@media (width <= 768px) {
37+
grid-template-columns: 100%;
38+
}
39+
}
40+
41+
.flex-50 {
42+
padding: 0.625rem 0;
43+
display: flex;
44+
align-items: center;
45+
border-bottom: 1px solid #ddd;
46+
}
47+
48+
.mat-body-strong {
49+
font-weight: 600;
50+
font-size: 0.875rem;
51+
}
52+
53+
div:not(.mat-body-strong) {
54+
font-size: 0.875rem;
855
word-wrap: break-word;
56+
line-height: 1.6;
957
}
1058
}
1159

12-
.main-icon {
13-
margin: 7px 0 0;
60+
@media (width <= 480px) {
61+
.header {
62+
padding: 1rem;
63+
64+
.main-icon {
65+
margin-bottom: 0.5rem;
66+
}
67+
68+
mat-card-title h2 {
69+
font-size: 1.25rem;
70+
}
71+
}
72+
73+
mat-card-content {
74+
padding: 1rem;
75+
}
1476
}

src/app/navigation/office-navigation/office-navigation.component.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
/** Angular Imports */
22
import { Component, Input } from '@angular/core';
3-
import {
4-
MatCardHeader,
5-
MatCardTitleGroup,
6-
MatCardTitle,
7-
MatCardSubtitle,
8-
MatCardContent
9-
} from '@angular/material/card';
3+
import { MatCardHeader, MatCardTitleGroup, MatCardTitle, MatCardContent } from '@angular/material/card';
104
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
115
import { ExternalIdentifierComponent } from '../../shared/external-identifier/external-identifier.component';
126
import { DateFormatPipe } from '../../pipes/date-format.pipe';
@@ -22,7 +16,6 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
2216
FaIconComponent,
2317
MatCardTitleGroup,
2418
MatCardTitle,
25-
MatCardSubtitle,
2619
ExternalIdentifierComponent,
2720
DateFormatPipe
2821
]

0 commit comments

Comments
 (0)