added & design btn-large component

This commit is contained in:
Chneemann 2024-08-01 15:42:43 +02:00
parent a8ae57ad84
commit 3eb3699ae8
6 changed files with 75 additions and 6 deletions

View file

@ -2,5 +2,7 @@
<div class="logo"> <div class="logo">
<img src="./../../../../assets/img/logo_full.svg" alt="" /> <img src="./../../../../assets/img/logo_full.svg" alt="" />
</div> </div>
<div class="btn">Log in</div> <div class="btn">
<app-btn-large [value]="'Log in'"></app-btn-large>
</div>
</header> </header>

View file

@ -1,12 +1,11 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { BtnLargeComponent } from '../../../shared/components/btn-large/btn-large.component';
@Component({ @Component({
selector: 'app-header', selector: 'app-header',
standalone: true, standalone: true,
imports: [], imports: [BtnLargeComponent],
templateUrl: './header.component.html', templateUrl: './header.component.html',
styleUrl: './header.component.scss' styleUrl: './header.component.scss',
}) })
export class HeaderComponent { export class HeaderComponent {}
}

View file

@ -0,0 +1,3 @@
<button class="btn" type="{{ type }}" [disabled]="disabled">
{{ value }}
</button>

View file

@ -0,0 +1,27 @@
@import "./../../../../assets/style/colors.scss";
.btn {
padding: 12px 24px;
width: fit-content;
box-shadow: 1px 1px 3px $gray;
border-radius: 24px;
color: $white;
background-color: $blue;
border: 1px solid $blue;
font-size: 18px;
font-weight: 600;
transition: background-color 300ms ease-in-out, color 300ms ease-in-out,
border 300ms ease-in-out;
cursor: pointer;
&:not(:disabled):hover {
color: $blue;
background-color: $white;
border: 1px solid $white;
}
&:disabled {
background-color: $gray;
color: darken($gray, 20%);
border: 1px solid $gray;
cursor: default;
}
}

View file

@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { BtnLargeComponent } from './btn-large.component';
describe('BtnLargeComponent', () => {
let component: BtnLargeComponent;
let fixture: ComponentFixture<BtnLargeComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [BtnLargeComponent]
})
.compileComponents();
fixture = TestBed.createComponent(BtnLargeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,15 @@
import { CommonModule } from '@angular/common';
import { Component, Input } from '@angular/core';
@Component({
selector: 'app-btn-large',
standalone: true,
imports: [CommonModule],
templateUrl: './btn-large.component.html',
styleUrl: './btn-large.component.scss',
})
export class BtnLargeComponent {
@Input() type: string = '';
@Input() value: string = '';
@Input() disabled: boolean = false;
}