Skip to content

Commit eb11a63

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

File tree

4 files changed

+166
-23
lines changed

4 files changed

+166
-23
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
gap: 12px;
30+
}
31+
32+
mat-form-field {
33+
width: 100%;
34+
}
35+
36+
mat-label {
37+
letter-spacing: 0.2px;
38+
}
39+
40+
@media (768px <= width) {
41+
mat-card-content {
42+
grid-template-columns: 50% 50%;
43+
}
44+
}
45+
46+
@media (1200px <= width) {
47+
.flex-48 {
48+
flex-basis: 48%;
49+
}
50+
51+
mat-card-content {
52+
grid-template-columns: 50% 50%;
53+
gap: 16px;
54+
}
55+
}

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: 101 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,108 @@
1-
h2 {
2-
font-weight: 500;
1+
:host {
2+
--header-icon-color: #000;
3+
--header-title-color: #000;
4+
--header-subtitle-color: #000;
5+
--field-label-color: #212121;
6+
--field-value-color: #000;
7+
--border-color: #ddd;
38
}
49

5-
.content {
6-
div {
7-
margin: 1rem 0;
10+
.header {
11+
padding: 1.5rem 1.5rem 1rem;
12+
align-items: center;
13+
gap: 1rem;
14+
15+
.main-icon {
16+
margin: 0;
17+
color: var(--header-icon-color, #000);
18+
transition: all 0.3s ease;
19+
20+
&:hover {
21+
transform: scale(1.05);
22+
}
23+
}
24+
25+
mat-card-title-group {
26+
display: flex;
27+
flex-direction: column;
28+
gap: 0.5rem;
29+
flex: 1;
30+
}
31+
32+
mat-card-title h2 {
33+
font-weight: 500;
34+
font-size: 1.5rem;
35+
color: var(--header-title-color, #000);
36+
margin: 0;
37+
line-height: 1.4;
38+
}
39+
}
40+
41+
mat-card-content {
42+
padding: 1.5rem;
43+
44+
.layout-row-wrap {
45+
display: grid;
46+
grid-template-columns: 50% 50%;
47+
gap: 0.75rem 1.5rem;
48+
49+
@media (width <= 768px) {
50+
grid-template-columns: 100%;
51+
gap: 0.75rem;
52+
}
53+
}
54+
55+
.flex-50 {
56+
padding: 0.625rem 0;
57+
display: flex;
58+
align-items: center;
59+
60+
&:not(:last-child, :nth-last-child(2)) {
61+
border-bottom: 1px solid var(--border-color, rgb(0 0 0 / 8%));
62+
}
63+
}
64+
65+
.mat-body-strong {
66+
font-weight: 600;
67+
color: var(--field-label-color);
68+
font-size: 0.875rem;
69+
text-transform: uppercase;
70+
letter-spacing: 0.5px;
71+
vertical-align: middle;
72+
}
73+
74+
div:not(.mat-body-strong) {
75+
color: var(--field-value-color);
76+
font-size: 0.875rem;
877
word-wrap: break-word;
78+
line-height: 1.6;
79+
vertical-align: middle;
80+
}
81+
}
82+
83+
@media (width <= 480px) {
84+
.header {
85+
padding: 1rem;
86+
87+
.main-icon {
88+
margin-bottom: 0.5rem;
89+
}
90+
91+
mat-card-title h2 {
92+
font-size: 1.25rem;
93+
}
94+
}
95+
96+
mat-card-content {
97+
padding: 1rem;
998
}
1099
}
11100

12-
.main-icon {
13-
margin: 7px 0 0;
101+
:host-context(.dark-theme) {
102+
--header-icon-color: #fff;
103+
--header-title-color: #fff;
104+
--header-subtitle-color: #e0e0e0;
105+
--field-label-color: #e0e0e0;
106+
--field-value-color: #d0d0d0;
107+
--border-color: rgb(255 255 255 / 20%);
14108
}

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)