Skip to content

Commit be4f0d0

Browse files
committed
feat: add layout core components
1 parent 45ef209 commit be4f0d0

49 files changed

Lines changed: 1322 additions & 16 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

angular.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"src/styles.scss",
3636
"node_modules/primeng/resources/themes/lara-light-blue/theme.css",
3737
"node_modules/primeng/resources/primeng.min.css",
38-
"node_modules/primeng/resources/themes/bootstrap4-light-blue/theme.css",
3938
"node_modules/primeflex/primeflex.css"
4039
],
4140
"scripts": []
@@ -45,13 +44,13 @@
4544
"budgets": [
4645
{
4746
"type": "initial",
48-
"maximumWarning": "500kB",
49-
"maximumError": "1MB"
47+
"maximumWarning": "1.5mb",
48+
"maximumError": "2mb"
5049
},
5150
{
5251
"type": "anyComponentStyle",
53-
"maximumWarning": "2kB",
54-
"maximumError": "4kB"
52+
"maximumWarning": "10kb",
53+
"maximumError": "50kb"
5554
}
5655
],
5756
"outputHashing": "all"
@@ -102,5 +101,8 @@
102101
}
103102
}
104103
}
104+
},
105+
"cli": {
106+
"analytics": false
105107
}
106108
}

src/app/app.component.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1-
<app-home-login></app-home-login>
1+
<div class="layout-wrapper" [ngClass]="containerClass">
2+
<app-topbar></app-topbar>
3+
<app-sidebar></app-sidebar>
4+
<div class="layout-main-container">
5+
<div class="layout-main">
6+
<router-outlet></router-outlet>
7+
</div>
8+
<app-footer></app-footer>
9+
</div>
10+
<div class="layout-mask animate-fadein"></div>
11+
</div>

src/app/app.component.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@use '../assets//layout/variables/_light';
2+
@use '../assets/layout/variables/_dark';
3+
@use '../assets/layout/variables/common';
4+
@use '../assets/layout/responsive';
5+
6+
.layout-wrapper {
7+
min-height: 100vh;
8+
}
9+
10+
.layout-main-container {
11+
display: flex;
12+
flex-direction: column;
13+
min-height: 100vh;
14+
justify-content: space-between;
15+
padding: 6rem 2rem 0 2rem;
16+
transition: margin-left .2s;
17+
}
18+
19+
.layout-main {
20+
flex: 1 1 auto;
21+
padding-bottom: 2rem;
22+
}

src/app/app.component.ts

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,38 @@
1-
import { Component } from '@angular/core';
1+
import { Component, ViewEncapsulation } from '@angular/core';
22
import { RouterOutlet } from '@angular/router';
3-
import { HomeLoginComponent } from "./features/login/components/home-login/home-login.component";
3+
import { MenuItem, PrimeNGConfig } from 'primeng/api';
4+
import { SharedModule } from './shared/shared.module';
5+
import { AppTopbarComponent } from "./core/layout/component/app-topbar/app-topbar.component";
6+
import { AppFooterComponent } from "./core/layout/component/app-footer/app-footer.component";
7+
import { AppSidebarComponent } from './core/layout/component/app-sidebar/app-sidebar.component';
48

59
@Component({
610
selector: 'app-root',
711
standalone: true,
812
imports: [
13+
SharedModule,
914
RouterOutlet,
10-
HomeLoginComponent
15+
AppTopbarComponent,
16+
AppFooterComponent,
17+
AppSidebarComponent
1118
],
1219
templateUrl: './app.component.html',
13-
styleUrl: './app.component.scss'
20+
styleUrl: './app.component.scss',
21+
encapsulation: ViewEncapsulation.None
1422
})
1523
export class AppComponent {
1624
title = 'TaskManagementClient';
25+
constructor(private primengConfig: PrimeNGConfig) {
26+
this.primengConfig.ripple = true;
27+
}
28+
29+
get containerClass() {
30+
return {
31+
'layout-overlay': false,
32+
'layout-static': true,
33+
'layout-static-inactive': false,
34+
'layout-overlay-active': false,
35+
'layout-mobile-active': false
36+
};
37+
}
1738
}

src/app/app.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
22
import { provideRouter } from '@angular/router';
3+
import { provideHttpClient } from '@angular/common/http';
34

45
import { routes } from './app.routes';
6+
import { provideAnimations } from '@angular/platform-browser/animations';
57

68
export const appConfig: ApplicationConfig = {
7-
providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes)]
9+
providers: [
10+
provideZoneChangeDetection({ eventCoalescing: true }),
11+
provideRouter(routes),
12+
provideHttpClient(),
13+
provideAnimations()]
814
};

src/app/app.routes.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
import { Routes } from '@angular/router';
2+
import { HomeLoginComponent } from './features/login/components/home-login/home-login.component';
3+
import { ProjectListComponent } from './features/projects/components/project-list/project-list.component';
4+
import { DashboardComponent } from './features/dashboard/components/dashboard/dashboard.component';
25

3-
export const routes: Routes = [];
6+
export const routes: Routes = [
7+
{ path: '', component: DashboardComponent },
8+
{ path: 'projects', component: ProjectListComponent },
9+
{ path: 'login', component: HomeLoginComponent },
10+
];

src/app/core/core.module.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
import { SharedModule } from '../shared/shared.module';
4+
import { StyleClassModule } from 'primeng/styleclass';
5+
6+
7+
8+
@NgModule({
9+
declarations: [],
10+
imports: [
11+
CommonModule,
12+
SharedModule,
13+
StyleClassModule
14+
]
15+
})
16+
export class CoreModule { }
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<div class="layout-footer">
2+
Task Management by
3+
<a href="https://github.com/Diogo-Ferraz" target="_blank" rel="noopener noreferrer" class="text-primary font-bold hover:underline">Diogo Ferraz</a>
4+
</div>`
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.layout-footer {
2+
display: flex;
3+
align-items: center;
4+
justify-content: center;
5+
padding: 1rem 0 1rem 0;
6+
gap: 0.5rem;
7+
border-top: 1px solid var(--surface-border);
8+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { AppFooterComponent } from './app-footer.component';
4+
5+
describe('AppFooterComponent', () => {
6+
let component: AppFooterComponent;
7+
let fixture: ComponentFixture<AppFooterComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
imports: [AppFooterComponent]
12+
})
13+
.compileComponents();
14+
15+
fixture = TestBed.createComponent(AppFooterComponent);
16+
component = fixture.componentInstance;
17+
fixture.detectChanges();
18+
});
19+
20+
it('should create', () => {
21+
expect(component).toBeTruthy();
22+
});
23+
});

0 commit comments

Comments
 (0)