Skip to content

Commit c6ed8e2

Browse files
shubhamkumar9199JaySoni1
authored andcommitted
refactor: improve navigation component CSS
1 parent 6d03bf2 commit c6ed8e2

File tree

3 files changed

+115
-35
lines changed

3 files changed

+115
-35
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Component-specific styles - minimal overrides
2+
// Leverages global layout classes from main.scss
3+
4+
:host {
5+
display: block;
6+
}
7+
8+
.container {
9+
width: 100%;
10+
}
11+
12+
// Using existing .layout-row-wrap.responsive-column from global styles
13+
// Only adding specific alignment needed for this component
14+
.layout-row-wrap.responsive-column {
15+
align-items: flex-start;
16+
}
17+
18+
// Extending global .flex-48 with min-width constraint for this component
19+
.flex-48 {
20+
min-width: 20rem;
21+
22+
@media (width >= 1200px) {
23+
flex-basis: 48%;
24+
}
25+
}
26+
27+
mat-card {
28+
padding: 1rem;
29+
border-radius: 0.5rem;
30+
overflow: hidden;
31+
}
32+
33+
mat-card-content {
34+
display: grid;
35+
grid-template-columns: 100%;
36+
37+
@media (width >= 768px) {
38+
grid-template-columns: 50% 50%;
39+
}
40+
41+
@media (width >= 1200px) {
42+
grid-template-columns: 50% 50%;
43+
gap: 1rem;
44+
}
45+
}
46+
47+
mat-form-field {
48+
width: 100%;
49+
}
50+
51+
mat-label {
52+
letter-spacing: 0.0125rem;
53+
}

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

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,31 @@
1-
<mat-card-header class="layout-row gap-5percent header">
2-
<fa-icon class="main-icon" icon="building" size="3x"></fa-icon>
3-
<mat-card-title-group>
4-
<div class="mat-typography">
5-
<mat-card-title>
6-
<h2>
7-
{{ officeData.name }}
8-
</h2>
9-
</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>
17-
</div>
1+
<mat-card-header class="layout-row align-items-center gap-10px">
2+
<fa-icon icon="building" size="3x"></fa-icon>
3+
<mat-card-title-group class="flex-fill">
4+
<mat-card-title>
5+
<h2>{{ officeData.name }}</h2>
6+
</mat-card-title>
187
</mat-card-title-group>
198
</mat-card-header>
209

2110
<mat-card-content>
2211
<div class="layout-row-wrap">
12+
<div class="flex-50 mat-body-strong" *ngIf="officeData.externalId">
13+
{{ 'labels.inputs.External Id' | translate }}
14+
</div>
15+
<div class="flex-50" *ngIf="officeData.externalId">
16+
<mifosx-external-identifier externalId="{{ officeData.externalId }}"></mifosx-external-identifier>
17+
</div>
18+
2319
<div class="flex-50 mat-body-strong">
2420
{{ 'labels.inputs.Opened On' | translate }}
2521
</div>
26-
2722
<div class="flex-50">
2823
{{ officeData.openingDate | dateFormat }}
2924
</div>
3025

31-
<div class="flex-50 mat-body-strong" *ngIf="officeData.parentName">
32-
{{ 'labels.inputs.Parent officeData' | translate }}
33-
</div>
34-
35-
<div class="flex-50" *ngIf="officeData.parentName">
36-
{{ officeData.parentName }}
37-
</div>
38-
3926
<div class="flex-50 mat-body-strong">
4027
{{ 'labels.inputs.Number of Staff' | translate }}
4128
</div>
42-
4329
<div class="flex-50">
4430
{{ employeeData ? employeeData.length : '' }}
4531
</div>
Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,55 @@
1-
h2 {
2-
font-weight: 500;
1+
// Component-specific styles - minimal overrides to global styles
2+
// Follows existing patterns from general-tab components
3+
4+
mat-card-header {
5+
padding: 1.5rem 1.5rem 1rem;
6+
7+
h2 {
8+
font-weight: 500;
9+
font-size: 1.5rem;
10+
margin: 0;
11+
line-height: 1.4;
12+
}
13+
14+
@media (width <= 480px) {
15+
padding: 1rem;
16+
17+
h2 {
18+
font-size: 1.25rem;
19+
}
20+
}
321
}
422

5-
.content {
6-
div {
7-
margin: 1rem 0;
23+
mat-card-content {
24+
padding: 1.5rem;
25+
26+
.layout-row-wrap {
27+
display: grid;
28+
grid-template-columns: 50% 50%;
29+
30+
@media (width <= 768px) {
31+
grid-template-columns: 100%;
32+
}
33+
}
34+
35+
.flex-50 {
36+
padding: 0.625rem 0;
37+
display: flex;
38+
align-items: center;
39+
font-size: 0.875rem;
840
word-wrap: break-word;
41+
line-height: 1.6;
42+
43+
&.mat-body-strong {
44+
font-weight: 600;
45+
}
46+
47+
&:not(:last-child, :nth-last-child(2)) {
48+
border-bottom: 1px solid #ddd;
49+
}
950
}
10-
}
1151

12-
.main-icon {
13-
margin: 7px 0 0;
52+
@media (width <= 480px) {
53+
padding: 1rem;
54+
}
1455
}

0 commit comments

Comments
 (0)