Skip to content

Commit a484779

Browse files
basic layout (#4)
* basic layout * use breakpoints
1 parent 549fa24 commit a484779

28 files changed

+341
-365
lines changed

angular.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
"cli": {
112112
"schematicCollections": [
113113
"angular-eslint"
114-
]
114+
],
115+
"analytics": false
115116
}
116117
}

package-lock.json

Lines changed: 19 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
},
1515
"private": true,
1616
"dependencies": {
17+
"@angular/cdk": "^19.2.1",
1718
"@angular/common": "^19.2.0",
1819
"@angular/compiler": "^19.2.0",
1920
"@angular/core": "^19.2.0",

src/app/app.component.html

Lines changed: 19 additions & 357 deletions
Large diffs are not rendered by default.

src/app/app.component.scss

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.layout-desktop {
2+
display: flex;
3+
height: 100vh;
4+
5+
.content {
6+
flex: 1;
7+
overflow-y: auto;
8+
display: flex;
9+
flex-direction: column;
10+
width: 100%;
11+
border: 6px solid #24384a;
12+
border-radius: 12px;
13+
box-sizing: content-box;
14+
15+
.content-wrapper {
16+
position: relative;
17+
display: flex;
18+
flex-direction: column;
19+
flex: 1;
20+
}
21+
}
22+
}
23+
24+
.layout-tablet {
25+
display: flex;
26+
height: 100vh;
27+
28+
.content {
29+
flex: 1;
30+
overflow-y: auto;
31+
display: flex;
32+
flex-direction: column;
33+
width: 100%;
34+
35+
.content-wrapper {
36+
position: relative;
37+
display: flex;
38+
flex-direction: column;
39+
flex: 1;
40+
}
41+
}
42+
}

src/app/app.component.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
1-
import { ChangeDetectionStrategy, Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
2+
import { SidenavComponent } from '@osf/sidenav/sidenav.component';
23
import { RouterOutlet } from '@angular/router';
4+
import { HeaderComponent } from '@osf/header/header.component';
5+
import { MainContentComponent } from '@osf/main-content/main-content.component';
6+
import { FooterComponent } from '@osf/footer/footer.component';
7+
import { TopnavComponent } from '@osf/topnav/topnav.component';
8+
import { IS_PORTRAIT } from '@shared/utils/breakpoints.tokens';
9+
import { toSignal } from '@angular/core/rxjs-interop';
310

411
@Component({
512
selector: 'osf-root',
6-
imports: [RouterOutlet],
13+
imports: [
14+
SidenavComponent,
15+
RouterOutlet,
16+
HeaderComponent,
17+
MainContentComponent,
18+
FooterComponent,
19+
TopnavComponent,
20+
],
721
templateUrl: './app.component.html',
822
styleUrl: './app.component.scss',
923
standalone: true,
1024
changeDetection: ChangeDetectionStrategy.OnPush,
1125
})
1226
export class AppComponent {
13-
title = 'osf';
27+
private isPortrait$ = inject(IS_PORTRAIT);
28+
isPortrait = toSignal(this.isPortrait$);
1429
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<p>footer works!</p>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
:host {
2+
height: 50px;
3+
background: aqua;
4+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { FooterComponent } from './footer.component';
4+
5+
describe('FooterComponent', () => {
6+
let component: FooterComponent;
7+
let fixture: ComponentFixture<FooterComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
imports: [FooterComponent],
12+
}).compileComponents();
13+
14+
fixture = TestBed.createComponent(FooterComponent);
15+
component = fixture.componentInstance;
16+
fixture.detectChanges();
17+
});
18+
19+
it('should create', () => {
20+
expect(component).toBeTruthy();
21+
});
22+
});

src/app/footer/footer.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
standalone: true,
5+
selector: 'osf-footer',
6+
imports: [],
7+
templateUrl: './footer.component.html',
8+
styleUrl: './footer.component.scss',
9+
})
10+
export class FooterComponent {}

0 commit comments

Comments
 (0)